Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
utils/Atomic.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* Atomic.h (C) 2000-2024 */
9/* */
10/* Types atomiques pour le multi-threading. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_ATOMIC_H
13#define ARCANE_UTILS_ATOMIC_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27/*!
28 * \brief Type 'Int32' atomique.
29 *
30 * \deprecated Cette classe est obsolète. Il faut utiliser std::atomic<Int32>
31 * à la place.
32 */
33class ARCANE_UTILS_EXPORT AtomicInt32
34{
35 public:
36
37 //! Constructeur: attention, aucune initialisation
38 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32> instead")
40 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32> instead")
41 AtomicInt32(Int32);
42
43 public:
44
45 Int32 operator++();
46 Int32 operator--();
47 Int32 value() const;
48 void operator=(Int32 v);
49
50 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32>::fetch_add(1) instead")
51 static Int32 increment(volatile Int32* v);
52
53 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32>::fetch_sub(1) instead")
54 static Int32 decrement(volatile Int32* v);
55
56 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32>::store() instead")
57 static void setValue(volatile Int32* v, Int32 new_v);
58
59 ARCANE_DEPRECATED_REASON("Y2022: Use std::atomic<Int32>::load() instead")
60 static Int32 getValue(volatile Int32* v);
61
62 private:
63
64 mutable Int32 m_value;
65};
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70} // namespace Arcane
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75#endif
Fichier de configuration d'Arcane.
Type 'Int32' atomique.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-