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
22
ARCANE_BEGIN_NAMESPACE
23
24
/*---------------------------------------------------------------------------*/
25
/*---------------------------------------------------------------------------*/
26
/*!
27
* \brief Section critique en multi-thread.
28
*/
29
class
ARCANE_UTILS_EXPORT
CriticalSection
30
{
31
public
:
32
CriticalSection
(
IThreadMng
* tm)
33
: m_thread_mng(tm)
34
{
35
m_thread_mng->beginCriticalSection();
36
}
37
~CriticalSection
()
38
{
39
m_thread_mng->endCriticalSection();
40
}
41
private
:
42
IThreadMng
* m_thread_mng;
43
};
44
45
/*---------------------------------------------------------------------------*/
46
/*---------------------------------------------------------------------------*/
47
48
ARCANE_END_NAMESPACE
49
50
/*---------------------------------------------------------------------------*/
51
/*---------------------------------------------------------------------------*/
52
53
#endif
Arcane::CriticalSection
Section critique en multi-thread.
Definition
CriticalSection.h:30
Arcane::IThreadMng
Interface d'un gestionnaire de thread.
Definition
IThreadMng.h:30
arcane
utils
CriticalSection.h
Généré le Lundi 18 Novembre 2024 02:56:53 pour Arcane par
1.9.8