Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
ordered_atomic.hpp
Go to the documentation of this file.
1 /*
2  * Author: Sven Gothel <sgothel@jausoft.com>
3  * Copyright (c) 2020 Gothel Software e.K.
4  * Copyright (c) 2020 ZAFENA AB
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sublicense, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be
15  * included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
26 #ifndef JAU_ORDERED_ATOMIC_HPP_
27 #define JAU_ORDERED_ATOMIC_HPP_
28 
29 #include <atomic>
30 #include <memory>
31 
32 #include <jau/basic_types.hpp>
33 
34 namespace jau {
35 
36 #ifndef CXX_ALWAYS_INLINE
37 # define CXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
38 #endif
39 
40 /**
41  * std::atomic<T> type with predefined fixed std::memory_order,
42  * not allowing changing the memory model on usage and applying the set order to all operator.
43  * <p>
44  * See also:
45  * <pre>
46  * - Sequentially Consistent (SC) ordering or SC-DRF (data race free) <https://en.cppreference.com/w/cpp/atomic/memory_order#Sequentially-consistent_ordering>
47  * - std::memory_order <https://en.cppreference.com/w/cpp/atomic/memory_order>
48  * </pre>
49  * </p>
50  */
51 template <typename _Tp, std::memory_order _MO> struct ordered_atomic : private std::atomic<_Tp> {
52  private:
53  typedef std::atomic<_Tp> super;
54 
55  public:
56  ordered_atomic() noexcept = default;
57  ~ordered_atomic() noexcept = default;
58  ordered_atomic(const ordered_atomic&) = delete;
59  ordered_atomic& operator=(const ordered_atomic&) = delete;
60  ordered_atomic& operator=(const ordered_atomic&) volatile = delete;
61 
62  constexpr ordered_atomic(_Tp __i) noexcept
63  : super(__i)
64  { }
65 
67  operator _Tp() const noexcept
68  { return super::load(_MO); }
69 
71  operator _Tp() const volatile noexcept
72  { return super::load(_MO); }
73 
75  _Tp operator=(_Tp __i) noexcept
76  { super::store(__i, _MO); return __i; }
77 
79  _Tp operator=(_Tp __i) volatile noexcept
80  { super::store(__i, _MO); return __i; }
81 
83  _Tp operator++(int) noexcept // postfix ++
84  { return super::fetch_add(1, _MO); }
85 
87  _Tp operator++(int) volatile noexcept // postfix ++
88  { return super::fetch_add(1, _MO); }
89 
91  _Tp operator--(int) noexcept // postfix --
92  { return super::fetch_sub(1, _MO); }
93 
95  _Tp operator--(int) volatile noexcept // postfix --
96  { return super::fetch_sub(1, _MO); }
97 
98 #if 0 /* def _GLIBCXX_ATOMIC_BASE_H */
99 
100  // prefix ++, -- impossible w/o using GCC __atomic builtins and access to _M_i .. etc
101 
103  _Tp operator++() noexcept // prefix ++
104  { return __atomic_add_fetch(&_M_i, 1, int(_MO)); }
105 
107  _Tp operator++() volatile noexcept // prefix ++
108  { return __atomic_add_fetch(&_M_i, 1, int(_MO)); }
109 
111  _Tp operator--() noexcept // prefix --
112  { return __atomic_sub_fetch(&_M_i, 1, int(_MO)); }
113 
115  _Tp operator--() volatile noexcept // prefix --
116  { return __atomic_sub_fetch(&_M_i, 1, int(_MO)); }
117 
118 #endif /* 0 _GLIBCXX_ATOMIC_BASE_H */
119 
121  bool is_lock_free() const noexcept
122  { return super::is_lock_free(); }
123 
125  bool is_lock_free() const volatile noexcept
126  { return super::is_lock_free(); }
127 
128  static constexpr bool is_always_lock_free = super::is_always_lock_free;
129 
131  void store(_Tp __i) noexcept
132  { super::store(__i, _MO); }
133 
135  void store(_Tp __i) volatile noexcept
136  { super::store(__i, _MO); }
137 
139  _Tp load() const noexcept
140  { return super::load(_MO); }
141 
143  _Tp load() const volatile noexcept
144  { return super::load(_MO); }
145 
147  _Tp exchange(_Tp __i) noexcept
148  { return super::exchange(__i, _MO); }
149 
151  _Tp exchange(_Tp __i) volatile noexcept
152  { return super::exchange(__i, _MO); }
153 
155  bool compare_exchange_weak(_Tp& __e, _Tp __i) noexcept
156  { return super::compare_exchange_weak(__e, __i, _MO); }
157 
159  bool compare_exchange_weak(_Tp& __e, _Tp __i) volatile noexcept
160  { return super::compare_exchange_weak(__e, __i, _MO); }
161 
163  bool compare_exchange_strong(_Tp& __e, _Tp __i) noexcept
164  { return super::compare_exchange_strong(__e, __i, _MO); }
165 
167  bool compare_exchange_strong(_Tp& __e, _Tp __i) volatile noexcept
168  { return super::compare_exchange_strong(__e, __i, _MO); }
169 
171  _Tp fetch_add(_Tp __i) noexcept
172  { return super::fetch_add(__i, _MO); }
173 
175  _Tp fetch_add(_Tp __i) volatile noexcept
176  { return super::fetch_add(__i, _MO); }
177 
179  _Tp fetch_sub(_Tp __i) noexcept
180  { return super::fetch_sub(__i, _MO); }
181 
183  _Tp fetch_sub(_Tp __i) volatile noexcept
184  { return super::fetch_sub(__i, _MO); }
185 
187  _Tp fetch_and(_Tp __i) noexcept
188  { return super::fetch_and(__i, _MO); }
189 
191  _Tp fetch_and(_Tp __i) volatile noexcept
192  { return super::fetch_and(__i, _MO); }
193 
195  _Tp fetch_or(_Tp __i) noexcept
196  { return super::fetch_or(__i, _MO); }
197 
199  _Tp fetch_or(_Tp __i) volatile noexcept
200  { return super::fetch_or(__i, _MO); }
201 
203  _Tp fetch_xor(_Tp __i) noexcept
204  { return super::fetch_xor(__i, _MO); }
205 
207  _Tp fetch_xor(_Tp __i) volatile noexcept
208  { return super::fetch_xor(__i, _MO); }
209 
210  };
211 
212  /** SC atomic integral scalar boolean. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
214 
215  /** Relaxed non-SC atomic integral scalar boolean. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
217 
218  /** SC atomic integral scalar int8_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
220 
221  /** Relaxed non-SC atomic integral scalar int8_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
223 
224  /** SC atomic integral scalar uint8_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
226 
227  /** Relaxed non-SC atomic integral scalar uint8_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
229 
230  /** SC atomic integral scalar int16_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
232 
233  /** Relaxed non-SC atomic integral scalar int16_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
235 
236  /** SC atomic integral scalar uint16_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
238 
239  /** Relaxed non-SC atomic integral scalar uint16_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
241 
242  /** SC atomic integral scalar integer. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
244 
245  /** Relaxed non-SC atomic integral scalar integer. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
247 
248  /** SC atomic integral scalar int32_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
250 
251  /** Relaxed non-SC atomic integral scalar int32_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
253 
254  /** SC atomic integral scalar uint32_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
256 
257  /** Relaxed non-SC atomic integral scalar uint32_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
259 
260  /** SC atomic integral scalar jau::nsize_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
262 
263  /** SC atomic integral scalar jau::snsize_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
265 
266  /** Relaxed non-SC atomic integral scalar jau::nsize_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
268 
269  /** Relaxed non-SC atomic integral scalar jau::snsize_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
271 
272  /** SC atomic integral scalar size_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
274 
275  /** SC atomic integral scalar ssize_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
277 
278  /** Relaxed non-SC atomic integral scalar size_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
280 
281  /** Relaxed non-SC atomic integral scalar ssize_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
283 
284  /** SC atomic integral scalar int64_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
286 
287  /** Relaxed non-SC atomic integral scalar int64_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
289 
290  /** SC atomic integral scalar uint64_t. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */
292 
293  /** Relaxed non-SC atomic integral scalar uint64_t. Memory-Model (MM) only guarantees the atomic value, _no_ sequential consistency (SC) between acquire (read) and release (write). */
295 
296  /**
297  * This class provides a RAII-style Sequentially Consistent (SC) data race free (DRF) critical block.
298  * <p>
299  * RAII-style SC-DRF acquire via constructor and SC-DRF release via destructor,
300  * providing a DRF critical block.
301  * </p>
302  * <p>
303  * This temporary object reuses a jau::sc_atomic_bool atomic synchronization element.
304  * The type of the acting atomic is not relevant, only its atomic SC-DRF properties.
305  * </p>
306  *
307  * See also:
308  * <pre>
309  * - Sequentially Consistent (SC) ordering or SC-DRF (data race free) <https://en.cppreference.com/w/cpp/atomic/memory_order#Sequentially-consistent_ordering>
310  * - std::memory_order <https://en.cppreference.com/w/cpp/atomic/memory_order>
311  * </pre>
312  * @see jau::ringbuffer
313  */
315  private:
316  sc_atomic_bool & sync_ref;
317  bool local_store;
318 
319  public:
320  /** SC-DRF acquire via sc_atomic_bool::load() */
321  sc_atomic_critical(sc_atomic_bool &sync) noexcept : sync_ref(sync), local_store(sync.load()) {}
322 
323  /** SC-DRF release via sc_atomic_bool::store() */
324  ~sc_atomic_critical() noexcept { sync_ref.store(local_store); }
325 
326  sc_atomic_critical() noexcept = delete;
328  sc_atomic_critical& operator=(const sc_atomic_critical&) = delete;
329  sc_atomic_critical& operator=(const sc_atomic_critical&) volatile = delete;
330  };
331 
332 } /* namespace jau */
333 
334 /** \example test_mm_sc_drf_00.cpp
335  * Testing SC-DRF non-atomic global read and write within an atomic acquire/release critical block.
336  * <p>
337  * With test_mm_sc_drf_00.cpp, this work laid the groundwork for jau::sc_atomic_critical and jau::ringbuffer
338  * </p>
339  */
340 
341 /** \example test_mm_sc_drf_01.cpp
342  * Testing SC-DRF non-atomic global read and write within a locked mutex critical block.
343  * <p>
344  * With test_mm_sc_drf_00.cpp, this work laid the groundwork for jau::sc_atomic_critical and jau::ringbuffer
345  * </p>
346  */
347 
348 #endif /* JAU_ORDERED_ATOMIC_HPP_ */
jau::ordered_atomic::compare_exchange_strong
CXX_ALWAYS_INLINE bool compare_exchange_strong(_Tp &__e, _Tp __i) noexcept
Definition: ordered_atomic.hpp:163
jau::ordered_atomic::is_always_lock_free
static constexpr bool is_always_lock_free
Definition: ordered_atomic.hpp:128
jau::ordered_atomic::fetch_add
CXX_ALWAYS_INLINE _Tp fetch_add(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:175
jau::ordered_atomic::exchange
CXX_ALWAYS_INLINE _Tp exchange(_Tp __i) noexcept
Definition: ordered_atomic.hpp:147
jau::relaxed_atomic_int32
ordered_atomic< int32_t, std::memory_order::memory_order_relaxed > relaxed_atomic_int32
Relaxed non-SC atomic integral scalar int32_t.
Definition: ordered_atomic.hpp:252
jau::relaxed_atomic_bool
ordered_atomic< bool, std::memory_order::memory_order_relaxed > relaxed_atomic_bool
Relaxed non-SC atomic integral scalar boolean.
Definition: ordered_atomic.hpp:216
jau::ordered_atomic::operator--
CXX_ALWAYS_INLINE _Tp operator--(int) noexcept
Definition: ordered_atomic.hpp:91
jau::sc_atomic_snsize_t
ordered_atomic< jau::snsize_t, std::memory_order::memory_order_seq_cst > sc_atomic_snsize_t
SC atomic integral scalar jau::snsize_t.
Definition: ordered_atomic.hpp:264
jau::sc_atomic_int32
ordered_atomic< int32_t, std::memory_order::memory_order_seq_cst > sc_atomic_int32
SC atomic integral scalar int32_t.
Definition: ordered_atomic.hpp:249
jau::ordered_atomic::fetch_or
CXX_ALWAYS_INLINE _Tp fetch_or(_Tp __i) noexcept
Definition: ordered_atomic.hpp:195
jau::ordered_atomic::store
CXX_ALWAYS_INLINE void store(_Tp __i) noexcept
Definition: ordered_atomic.hpp:131
jau::ordered_atomic::fetch_sub
CXX_ALWAYS_INLINE _Tp fetch_sub(_Tp __i) noexcept
Definition: ordered_atomic.hpp:179
jau::sc_atomic_int64
ordered_atomic< int64_t, std::memory_order::memory_order_seq_cst > sc_atomic_int64
SC atomic integral scalar int64_t.
Definition: ordered_atomic.hpp:285
jau::ordered_atomic::fetch_sub
CXX_ALWAYS_INLINE _Tp fetch_sub(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:183
jau::sc_atomic_nsize_t
ordered_atomic< jau::nsize_t, std::memory_order::memory_order_seq_cst > sc_atomic_nsize_t
SC atomic integral scalar jau::nsize_t.
Definition: ordered_atomic.hpp:261
jau::ordered_atomic::compare_exchange_weak
CXX_ALWAYS_INLINE bool compare_exchange_weak(_Tp &__e, _Tp __i) noexcept
Definition: ordered_atomic.hpp:155
jau::ordered_atomic::fetch_or
CXX_ALWAYS_INLINE _Tp fetch_or(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:199
jau::relaxed_atomic_int64
ordered_atomic< int64_t, std::memory_order::memory_order_relaxed > relaxed_atomic_int64
Relaxed non-SC atomic integral scalar int64_t.
Definition: ordered_atomic.hpp:288
jau::ordered_atomic::exchange
CXX_ALWAYS_INLINE _Tp exchange(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:151
jau::ordered_atomic::ordered_atomic
ordered_atomic() noexcept=default
jau
Definition: basic_algos.hpp:34
jau::sc_atomic_int
ordered_atomic< int, std::memory_order::memory_order_seq_cst > sc_atomic_int
SC atomic integral scalar integer.
Definition: ordered_atomic.hpp:243
jau::relaxed_atomic_uint32
ordered_atomic< uint32_t, std::memory_order::memory_order_relaxed > relaxed_atomic_uint32
Relaxed non-SC atomic integral scalar uint32_t.
Definition: ordered_atomic.hpp:258
jau::sc_atomic_critical::~sc_atomic_critical
~sc_atomic_critical() noexcept
SC-DRF release via sc_atomic_bool::store()
Definition: ordered_atomic.hpp:324
jau::sc_atomic_critical::sc_atomic_critical
sc_atomic_critical(sc_atomic_bool &sync) noexcept
SC-DRF acquire via sc_atomic_bool::load()
Definition: ordered_atomic.hpp:321
jau::sc_atomic_bool
ordered_atomic< bool, std::memory_order::memory_order_seq_cst > sc_atomic_bool
SC atomic integral scalar boolean.
Definition: ordered_atomic.hpp:213
jau::ordered_atomic::fetch_and
CXX_ALWAYS_INLINE _Tp fetch_and(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:191
jau::ordered_atomic::load
CXX_ALWAYS_INLINE _Tp load() const volatile noexcept
Definition: ordered_atomic.hpp:143
jau::relaxed_atomic_uint8
ordered_atomic< uint8_t, std::memory_order::memory_order_relaxed > relaxed_atomic_uint8
Relaxed non-SC atomic integral scalar uint8_t.
Definition: ordered_atomic.hpp:228
jau::relaxed_atomic_nsize_t
ordered_atomic< jau::nsize_t, std::memory_order::memory_order_relaxed > relaxed_atomic_nsize_t
Relaxed non-SC atomic integral scalar jau::nsize_t.
Definition: ordered_atomic.hpp:267
jau::ordered_atomic::fetch_and
CXX_ALWAYS_INLINE _Tp fetch_and(_Tp __i) noexcept
Definition: ordered_atomic.hpp:187
jau::ordered_atomic
std::atomic<T> type with predefined fixed std::memory_order, not allowing changing the memory model o...
Definition: ordered_atomic.hpp:51
jau::ordered_atomic::operator=
CXX_ALWAYS_INLINE _Tp operator=(_Tp __i) noexcept
Definition: ordered_atomic.hpp:75
jau::ordered_atomic::is_lock_free
CXX_ALWAYS_INLINE bool is_lock_free() const noexcept
Definition: ordered_atomic.hpp:121
jau::relaxed_atomic_ssize_t
ordered_atomic< ssize_t, std::memory_order::memory_order_relaxed > relaxed_atomic_ssize_t
Relaxed non-SC atomic integral scalar ssize_t.
Definition: ordered_atomic.hpp:282
jau::ordered_atomic::load
CXX_ALWAYS_INLINE _Tp load() const noexcept
Definition: ordered_atomic.hpp:139
jau::relaxed_atomic_int8
ordered_atomic< int8_t, std::memory_order::memory_order_relaxed > relaxed_atomic_int8
Relaxed non-SC atomic integral scalar int8_t.
Definition: ordered_atomic.hpp:222
jau::sc_atomic_critical
This class provides a RAII-style Sequentially Consistent (SC) data race free (DRF) critical block.
Definition: ordered_atomic.hpp:314
jau::sc_atomic_uint64
ordered_atomic< uint64_t, std::memory_order::memory_order_seq_cst > sc_atomic_uint64
SC atomic integral scalar uint64_t.
Definition: ordered_atomic.hpp:291
jau::sc_atomic_int16
ordered_atomic< int16_t, std::memory_order::memory_order_seq_cst > sc_atomic_int16
SC atomic integral scalar int16_t.
Definition: ordered_atomic.hpp:231
jau::sc_atomic_uint32
ordered_atomic< uint32_t, std::memory_order::memory_order_seq_cst > sc_atomic_uint32
SC atomic integral scalar uint32_t.
Definition: ordered_atomic.hpp:255
jau::relaxed_atomic_int16
ordered_atomic< int16_t, std::memory_order::memory_order_relaxed > relaxed_atomic_int16
Relaxed non-SC atomic integral scalar int16_t.
Definition: ordered_atomic.hpp:234
jau::relaxed_atomic_uint16
ordered_atomic< uint16_t, std::memory_order::memory_order_relaxed > relaxed_atomic_uint16
Relaxed non-SC atomic integral scalar uint16_t.
Definition: ordered_atomic.hpp:240
jau::ordered_atomic::fetch_xor
CXX_ALWAYS_INLINE _Tp fetch_xor(_Tp __i) noexcept
Definition: ordered_atomic.hpp:203
CXX_ALWAYS_INLINE
#define CXX_ALWAYS_INLINE
Definition: ordered_atomic.hpp:37
jau::ordered_atomic::operator++
CXX_ALWAYS_INLINE _Tp operator++(int) volatile noexcept
Definition: ordered_atomic.hpp:87
jau::ordered_atomic::operator--
CXX_ALWAYS_INLINE _Tp operator--(int) volatile noexcept
Definition: ordered_atomic.hpp:95
jau::ordered_atomic::operator=
CXX_ALWAYS_INLINE _Tp operator=(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:79
jau::sc_atomic_uint8
ordered_atomic< uint8_t, std::memory_order::memory_order_seq_cst > sc_atomic_uint8
SC atomic integral scalar uint8_t.
Definition: ordered_atomic.hpp:225
jau::ordered_atomic::compare_exchange_weak
CXX_ALWAYS_INLINE bool compare_exchange_weak(_Tp &__e, _Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:159
jau::sc_atomic_ssize_t
jau::ordered_atomic< ssize_t, std::memory_order::memory_order_seq_cst > sc_atomic_ssize_t
SC atomic integral scalar ssize_t.
Definition: ordered_atomic.hpp:276
jau::relaxed_atomic_size_t
ordered_atomic< std::size_t, std::memory_order::memory_order_relaxed > relaxed_atomic_size_t
Relaxed non-SC atomic integral scalar size_t.
Definition: ordered_atomic.hpp:279
jau::ordered_atomic::operator++
CXX_ALWAYS_INLINE _Tp operator++(int) noexcept
Definition: ordered_atomic.hpp:83
jau::ordered_atomic::fetch_add
CXX_ALWAYS_INLINE _Tp fetch_add(_Tp __i) noexcept
Definition: ordered_atomic.hpp:171
jau::relaxed_atomic_snsize_t
ordered_atomic< jau::snsize_t, std::memory_order::memory_order_relaxed > relaxed_atomic_snsize_t
Relaxed non-SC atomic integral scalar jau::snsize_t.
Definition: ordered_atomic.hpp:270
jau::sc_atomic_int8
ordered_atomic< int8_t, std::memory_order::memory_order_seq_cst > sc_atomic_int8
SC atomic integral scalar int8_t.
Definition: ordered_atomic.hpp:219
jau::relaxed_atomic_int
ordered_atomic< int, std::memory_order::memory_order_relaxed > relaxed_atomic_int
Relaxed non-SC atomic integral scalar integer.
Definition: ordered_atomic.hpp:246
basic_types.hpp
jau::relaxed_atomic_uint64
ordered_atomic< uint64_t, std::memory_order::memory_order_relaxed > relaxed_atomic_uint64
Relaxed non-SC atomic integral scalar uint64_t.
Definition: ordered_atomic.hpp:294
jau::ordered_atomic::is_lock_free
CXX_ALWAYS_INLINE bool is_lock_free() const volatile noexcept
Definition: ordered_atomic.hpp:125
jau::sc_atomic_critical::sc_atomic_critical
sc_atomic_critical() noexcept=delete
jau::ordered_atomic::compare_exchange_strong
CXX_ALWAYS_INLINE bool compare_exchange_strong(_Tp &__e, _Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:167
jau::sc_atomic_size_t
ordered_atomic< std::size_t, std::memory_order::memory_order_seq_cst > sc_atomic_size_t
SC atomic integral scalar size_t.
Definition: ordered_atomic.hpp:273
jau::ordered_atomic::store
CXX_ALWAYS_INLINE void store(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:135
jau::sc_atomic_uint16
ordered_atomic< uint16_t, std::memory_order::memory_order_seq_cst > sc_atomic_uint16
SC atomic integral scalar uint16_t.
Definition: ordered_atomic.hpp:237
jau::ordered_atomic::fetch_xor
CXX_ALWAYS_INLINE _Tp fetch_xor(_Tp __i) volatile noexcept
Definition: ordered_atomic.hpp:207