Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
SharedMemoryThreadMng.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* SharedMemoryThreadMng.h (C) 2000-2024 */
9/* */
10/* Implémentation de IThreadMng pour la mémoire partagée. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYTHREADMNG_H
13#define ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYTHREADMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/parallel/thread/ArcaneThread.h"
18
19#include <mutex>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
31: public IThreadMng
32{
33 public:
34
35 void beginCriticalSection() override
36 {
37 m_mutex.lock();
38 }
39 void endCriticalSection() override
40 {
41 m_mutex.unlock();
42 }
43
44 private:
45
46 std::mutex m_mutex;
47};
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52} // End namespace Arcane
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
57#endif
Interface d'un gestionnaire de thread.
Definition IThreadMng.h:30
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-