Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
CriticalSection.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/* CriticalSection.h (C) 2000-2008 */
9/* */
10/* Section critique en multi-thread. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_CRITICALSECTION_H
13#define ARCANE_UTILS_CRITICALSECTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IThreadMng.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22ARCANE_BEGIN_NAMESPACE
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26/*!
27 * \brief Section critique en multi-thread.
28 */
29class ARCANE_UTILS_EXPORT CriticalSection
30{
31 public:
33 : m_thread_mng(tm)
34 {
35 m_thread_mng->beginCriticalSection();
36 }
38 {
39 m_thread_mng->endCriticalSection();
40 }
41 private:
42 IThreadMng* m_thread_mng;
43};
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
48ARCANE_END_NAMESPACE
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53#endif
Section critique en multi-thread.
Interface d'un gestionnaire de thread.
Definition IThreadMng.h:30