libstdc++
atomic
Go to the documentation of this file.
1 // -*- C++ -*- header.
2 
3 // Copyright (C) 2008-2016 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 /** @file include/atomic
26  * This is a Standard C++ Library header.
27  */
28 
29 // Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
30 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
31 
32 #ifndef _GLIBCXX_ATOMIC
33 #define _GLIBCXX_ATOMIC 1
34 
35 #pragma GCC system_header
36 
37 #if __cplusplus < 201103L
38 # include <bits/c++0x_warning.h>
39 #else
40 
41 #include <bits/atomic_base.h>
42 #include <bits/move.h>
43 
44 namespace std _GLIBCXX_VISIBILITY(default)
45 {
46 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 
48  /**
49  * @addtogroup atomics
50  * @{
51  */
52 
53 #if __cplusplus > 201402L
54 # define __cpp_lib_atomic_is_always_lock_free 201603
55 #endif
56 
57  template<typename _Tp>
58  struct atomic;
59 
60  /// atomic<bool>
61  // NB: No operators or fetch-operations for this type.
62  template<>
63  struct atomic<bool>
64  {
65  private:
66  __atomic_base<bool> _M_base;
67 
68  public:
69  atomic() noexcept = default;
70  ~atomic() noexcept = default;
71  atomic(const atomic&) = delete;
72  atomic& operator=(const atomic&) = delete;
73  atomic& operator=(const atomic&) volatile = delete;
74 
75  constexpr atomic(bool __i) noexcept : _M_base(__i) { }
76 
77  bool
78  operator=(bool __i) noexcept
79  { return _M_base.operator=(__i); }
80 
81  bool
82  operator=(bool __i) volatile noexcept
83  { return _M_base.operator=(__i); }
84 
85  operator bool() const noexcept
86  { return _M_base.load(); }
87 
88  operator bool() const volatile noexcept
89  { return _M_base.load(); }
90 
91  bool
92  is_lock_free() const noexcept { return _M_base.is_lock_free(); }
93 
94  bool
95  is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
96 
97 #if __cplusplus > 201402L
98  static constexpr bool is_always_lock_free = ATOMIC_BOOL_LOCK_FREE == 2;
99 #endif
100 
101  void
102  store(bool __i, memory_order __m = memory_order_seq_cst) noexcept
103  { _M_base.store(__i, __m); }
104 
105  void
106  store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept
107  { _M_base.store(__i, __m); }
108 
109  bool
110  load(memory_order __m = memory_order_seq_cst) const noexcept
111  { return _M_base.load(__m); }
112 
113  bool
114  load(memory_order __m = memory_order_seq_cst) const volatile noexcept
115  { return _M_base.load(__m); }
116 
117  bool
118  exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept
119  { return _M_base.exchange(__i, __m); }
120 
121  bool
122  exchange(bool __i,
123  memory_order __m = memory_order_seq_cst) volatile noexcept
124  { return _M_base.exchange(__i, __m); }
125 
126  bool
127  compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
128  memory_order __m2) noexcept
129  { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
130 
131  bool
132  compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
133  memory_order __m2) volatile noexcept
134  { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
135 
136  bool
137  compare_exchange_weak(bool& __i1, bool __i2,
138  memory_order __m = memory_order_seq_cst) noexcept
139  { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
140 
141  bool
142  compare_exchange_weak(bool& __i1, bool __i2,
143  memory_order __m = memory_order_seq_cst) volatile noexcept
144  { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
145 
146  bool
147  compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
148  memory_order __m2) noexcept
149  { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
150 
151  bool
152  compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
153  memory_order __m2) volatile noexcept
154  { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
155 
156  bool
157  compare_exchange_strong(bool& __i1, bool __i2,
158  memory_order __m = memory_order_seq_cst) noexcept
159  { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
160 
161  bool
162  compare_exchange_strong(bool& __i1, bool __i2,
163  memory_order __m = memory_order_seq_cst) volatile noexcept
164  { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
165  };
166 
167 
168  /**
169  * @brief Generic atomic type, primary class template.
170  *
171  * @tparam _Tp Type to be made atomic, must be trivally copyable.
172  */
173  template<typename _Tp>
174  struct atomic
175  {
176  private:
177  // Align 1/2/4/8/16-byte types to at least their size.
178  static constexpr int _S_min_alignment
179  = (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16
180  ? 0 : sizeof(_Tp);
181 
182  static constexpr int _S_alignment
183  = _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp);
184 
185  alignas(_S_alignment) _Tp _M_i;
186 
187  static_assert(__is_trivially_copyable(_Tp),
188  "std::atomic requires a trivially copyable type");
189 
190  static_assert(sizeof(_Tp) > 0,
191  "Incomplete or zero-sized types are not supported");
192 
193  public:
194  atomic() noexcept = default;
195  ~atomic() noexcept = default;
196  atomic(const atomic&) = delete;
197  atomic& operator=(const atomic&) = delete;
198  atomic& operator=(const atomic&) volatile = delete;
199 
200  constexpr atomic(_Tp __i) noexcept : _M_i(__i) { }
201 
202  operator _Tp() const noexcept
203  { return load(); }
204 
205  operator _Tp() const volatile noexcept
206  { return load(); }
207 
208  _Tp
209  operator=(_Tp __i) noexcept
210  { store(__i); return __i; }
211 
212  _Tp
213  operator=(_Tp __i) volatile noexcept
214  { store(__i); return __i; }
215 
216  bool
217  is_lock_free() const noexcept
218  {
219  // Produce a fake, minimally aligned pointer.
220  return __atomic_is_lock_free(sizeof(_M_i),
221  reinterpret_cast<void *>(-__alignof(_M_i)));
222  }
223 
224  bool
225  is_lock_free() const volatile noexcept
226  {
227  // Produce a fake, minimally aligned pointer.
228  return __atomic_is_lock_free(sizeof(_M_i),
229  reinterpret_cast<void *>(-__alignof(_M_i)));
230  }
231 
232 #if __cplusplus > 201402L
233  static constexpr bool is_always_lock_free
234  = __atomic_always_lock_free(sizeof(_M_i), 0);
235 #endif
236 
237  void
238  store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
239  { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
240 
241  void
242  store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept
243  { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
244 
245  _Tp
246  load(memory_order __m = memory_order_seq_cst) const noexcept
247  {
248  _Tp tmp;
249  __atomic_load(std::__addressof(_M_i), std::__addressof(tmp), __m);
250  return tmp;
251  }
252 
253  _Tp
254  load(memory_order __m = memory_order_seq_cst) const volatile noexcept
255  {
256  _Tp tmp;
257  __atomic_load(std::__addressof(_M_i), std::__addressof(tmp), __m);
258  return tmp;
259  }
260 
261  _Tp
262  exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
263  {
264  _Tp tmp;
265  __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
266  std::__addressof(tmp), __m);
267  return tmp;
268  }
269 
270  _Tp
271  exchange(_Tp __i,
272  memory_order __m = memory_order_seq_cst) volatile noexcept
273  {
274  _Tp tmp;
275  __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
276  std::__addressof(tmp), __m);
277  return tmp;
278  }
279 
280  bool
281  compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
282  memory_order __f) noexcept
283  {
284  return __atomic_compare_exchange(std::__addressof(_M_i),
285  std::__addressof(__e),
286  std::__addressof(__i),
287  true, __s, __f);
288  }
289 
290  bool
291  compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
292  memory_order __f) volatile noexcept
293  {
294  return __atomic_compare_exchange(std::__addressof(_M_i),
295  std::__addressof(__e),
296  std::__addressof(__i),
297  true, __s, __f);
298  }
299 
300  bool
301  compare_exchange_weak(_Tp& __e, _Tp __i,
302  memory_order __m = memory_order_seq_cst) noexcept
303  { return compare_exchange_weak(__e, __i, __m,
304  __cmpexch_failure_order(__m)); }
305 
306  bool
307  compare_exchange_weak(_Tp& __e, _Tp __i,
308  memory_order __m = memory_order_seq_cst) volatile noexcept
309  { return compare_exchange_weak(__e, __i, __m,
310  __cmpexch_failure_order(__m)); }
311 
312  bool
313  compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
314  memory_order __f) noexcept
315  {
316  return __atomic_compare_exchange(std::__addressof(_M_i),
317  std::__addressof(__e),
318  std::__addressof(__i),
319  false, __s, __f);
320  }
321 
322  bool
323  compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
324  memory_order __f) volatile noexcept
325  {
326  return __atomic_compare_exchange(std::__addressof(_M_i),
327  std::__addressof(__e),
328  std::__addressof(__i),
329  false, __s, __f);
330  }
331 
332  bool
333  compare_exchange_strong(_Tp& __e, _Tp __i,
334  memory_order __m = memory_order_seq_cst) noexcept
335  { return compare_exchange_strong(__e, __i, __m,
336  __cmpexch_failure_order(__m)); }
337 
338  bool
339  compare_exchange_strong(_Tp& __e, _Tp __i,
340  memory_order __m = memory_order_seq_cst) volatile noexcept
341  { return compare_exchange_strong(__e, __i, __m,
342  __cmpexch_failure_order(__m)); }
343  };
344 
345 
346  /// Partial specialization for pointer types.
347  template<typename _Tp>
348  struct atomic<_Tp*>
349  {
350  typedef _Tp* __pointer_type;
352  __base_type _M_b;
353 
354  atomic() noexcept = default;
355  ~atomic() noexcept = default;
356  atomic(const atomic&) = delete;
357  atomic& operator=(const atomic&) = delete;
358  atomic& operator=(const atomic&) volatile = delete;
359 
360  constexpr atomic(__pointer_type __p) noexcept : _M_b(__p) { }
361 
362  operator __pointer_type() const noexcept
363  { return __pointer_type(_M_b); }
364 
365  operator __pointer_type() const volatile noexcept
366  { return __pointer_type(_M_b); }
367 
368  __pointer_type
369  operator=(__pointer_type __p) noexcept
370  { return _M_b.operator=(__p); }
371 
372  __pointer_type
373  operator=(__pointer_type __p) volatile noexcept
374  { return _M_b.operator=(__p); }
375 
376  __pointer_type
377  operator++(int) noexcept
378  { return _M_b++; }
379 
380  __pointer_type
381  operator++(int) volatile noexcept
382  { return _M_b++; }
383 
384  __pointer_type
385  operator--(int) noexcept
386  { return _M_b--; }
387 
388  __pointer_type
389  operator--(int) volatile noexcept
390  { return _M_b--; }
391 
392  __pointer_type
393  operator++() noexcept
394  { return ++_M_b; }
395 
396  __pointer_type
397  operator++() volatile noexcept
398  { return ++_M_b; }
399 
400  __pointer_type
401  operator--() noexcept
402  { return --_M_b; }
403 
404  __pointer_type
405  operator--() volatile noexcept
406  { return --_M_b; }
407 
408  __pointer_type
409  operator+=(ptrdiff_t __d) noexcept
410  { return _M_b.operator+=(__d); }
411 
412  __pointer_type
413  operator+=(ptrdiff_t __d) volatile noexcept
414  { return _M_b.operator+=(__d); }
415 
416  __pointer_type
417  operator-=(ptrdiff_t __d) noexcept
418  { return _M_b.operator-=(__d); }
419 
420  __pointer_type
421  operator-=(ptrdiff_t __d) volatile noexcept
422  { return _M_b.operator-=(__d); }
423 
424  bool
425  is_lock_free() const noexcept
426  { return _M_b.is_lock_free(); }
427 
428  bool
429  is_lock_free() const volatile noexcept
430  { return _M_b.is_lock_free(); }
431 
432 #if __cplusplus > 201402L
433  static constexpr bool is_always_lock_free = ATOMIC_POINTER_LOCK_FREE == 2;
434 #endif
435 
436  void
437  store(__pointer_type __p,
438  memory_order __m = memory_order_seq_cst) noexcept
439  { return _M_b.store(__p, __m); }
440 
441  void
442  store(__pointer_type __p,
443  memory_order __m = memory_order_seq_cst) volatile noexcept
444  { return _M_b.store(__p, __m); }
445 
446  __pointer_type
447  load(memory_order __m = memory_order_seq_cst) const noexcept
448  { return _M_b.load(__m); }
449 
450  __pointer_type
451  load(memory_order __m = memory_order_seq_cst) const volatile noexcept
452  { return _M_b.load(__m); }
453 
454  __pointer_type
455  exchange(__pointer_type __p,
456  memory_order __m = memory_order_seq_cst) noexcept
457  { return _M_b.exchange(__p, __m); }
458 
459  __pointer_type
460  exchange(__pointer_type __p,
461  memory_order __m = memory_order_seq_cst) volatile noexcept
462  { return _M_b.exchange(__p, __m); }
463 
464  bool
465  compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
466  memory_order __m1, memory_order __m2) noexcept
467  { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
468 
469  bool
470  compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
471  memory_order __m1,
472  memory_order __m2) volatile noexcept
473  { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
474 
475  bool
476  compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
477  memory_order __m = memory_order_seq_cst) noexcept
478  {
479  return compare_exchange_weak(__p1, __p2, __m,
480  __cmpexch_failure_order(__m));
481  }
482 
483  bool
484  compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
485  memory_order __m = memory_order_seq_cst) volatile noexcept
486  {
487  return compare_exchange_weak(__p1, __p2, __m,
488  __cmpexch_failure_order(__m));
489  }
490 
491  bool
492  compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
493  memory_order __m1, memory_order __m2) noexcept
494  { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
495 
496  bool
497  compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
498  memory_order __m1,
499  memory_order __m2) volatile noexcept
500  { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
501 
502  bool
503  compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
504  memory_order __m = memory_order_seq_cst) noexcept
505  {
506  return _M_b.compare_exchange_strong(__p1, __p2, __m,
507  __cmpexch_failure_order(__m));
508  }
509 
510  bool
511  compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
512  memory_order __m = memory_order_seq_cst) volatile noexcept
513  {
514  return _M_b.compare_exchange_strong(__p1, __p2, __m,
515  __cmpexch_failure_order(__m));
516  }
517 
518  __pointer_type
519  fetch_add(ptrdiff_t __d,
520  memory_order __m = memory_order_seq_cst) noexcept
521  { return _M_b.fetch_add(__d, __m); }
522 
523  __pointer_type
524  fetch_add(ptrdiff_t __d,
525  memory_order __m = memory_order_seq_cst) volatile noexcept
526  { return _M_b.fetch_add(__d, __m); }
527 
528  __pointer_type
529  fetch_sub(ptrdiff_t __d,
530  memory_order __m = memory_order_seq_cst) noexcept
531  { return _M_b.fetch_sub(__d, __m); }
532 
533  __pointer_type
534  fetch_sub(ptrdiff_t __d,
535  memory_order __m = memory_order_seq_cst) volatile noexcept
536  { return _M_b.fetch_sub(__d, __m); }
537  };
538 
539 
540  /// Explicit specialization for char.
541  template<>
542  struct atomic<char> : __atomic_base<char>
543  {
544  typedef char __integral_type;
546 
547  atomic() noexcept = default;
548  ~atomic() noexcept = default;
549  atomic(const atomic&) = delete;
550  atomic& operator=(const atomic&) = delete;
551  atomic& operator=(const atomic&) volatile = delete;
552 
553  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
554 
555  using __base_type::operator __integral_type;
556  using __base_type::operator=;
557 
558 #if __cplusplus > 201402L
559  static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
560 #endif
561  };
562 
563  /// Explicit specialization for signed char.
564  template<>
565  struct atomic<signed char> : __atomic_base<signed char>
566  {
567  typedef signed char __integral_type;
569 
570  atomic() noexcept= default;
571  ~atomic() noexcept = default;
572  atomic(const atomic&) = delete;
573  atomic& operator=(const atomic&) = delete;
574  atomic& operator=(const atomic&) volatile = delete;
575 
576  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
577 
578  using __base_type::operator __integral_type;
579  using __base_type::operator=;
580 
581 #if __cplusplus > 201402L
582  static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
583 #endif
584  };
585 
586  /// Explicit specialization for unsigned char.
587  template<>
588  struct atomic<unsigned char> : __atomic_base<unsigned char>
589  {
590  typedef unsigned char __integral_type;
592 
593  atomic() noexcept= default;
594  ~atomic() noexcept = default;
595  atomic(const atomic&) = delete;
596  atomic& operator=(const atomic&) = delete;
597  atomic& operator=(const atomic&) volatile = delete;
598 
599  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
600 
601  using __base_type::operator __integral_type;
602  using __base_type::operator=;
603 
604 #if __cplusplus > 201402L
605  static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
606 #endif
607  };
608 
609  /// Explicit specialization for short.
610  template<>
611  struct atomic<short> : __atomic_base<short>
612  {
613  typedef short __integral_type;
615 
616  atomic() noexcept = default;
617  ~atomic() noexcept = default;
618  atomic(const atomic&) = delete;
619  atomic& operator=(const atomic&) = delete;
620  atomic& operator=(const atomic&) volatile = delete;
621 
622  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
623 
624  using __base_type::operator __integral_type;
625  using __base_type::operator=;
626 
627 #if __cplusplus > 201402L
628  static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
629 #endif
630  };
631 
632  /// Explicit specialization for unsigned short.
633  template<>
634  struct atomic<unsigned short> : __atomic_base<unsigned short>
635  {
636  typedef unsigned short __integral_type;
638 
639  atomic() noexcept = default;
640  ~atomic() noexcept = default;
641  atomic(const atomic&) = delete;
642  atomic& operator=(const atomic&) = delete;
643  atomic& operator=(const atomic&) volatile = delete;
644 
645  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
646 
647  using __base_type::operator __integral_type;
648  using __base_type::operator=;
649 
650 #if __cplusplus > 201402L
651  static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
652 #endif
653  };
654 
655  /// Explicit specialization for int.
656  template<>
657  struct atomic<int> : __atomic_base<int>
658  {
659  typedef int __integral_type;
661 
662  atomic() noexcept = default;
663  ~atomic() noexcept = default;
664  atomic(const atomic&) = delete;
665  atomic& operator=(const atomic&) = delete;
666  atomic& operator=(const atomic&) volatile = delete;
667 
668  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
669 
670  using __base_type::operator __integral_type;
671  using __base_type::operator=;
672 
673 #if __cplusplus > 201402L
674  static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
675 #endif
676  };
677 
678  /// Explicit specialization for unsigned int.
679  template<>
680  struct atomic<unsigned int> : __atomic_base<unsigned int>
681  {
682  typedef unsigned int __integral_type;
684 
685  atomic() noexcept = default;
686  ~atomic() noexcept = default;
687  atomic(const atomic&) = delete;
688  atomic& operator=(const atomic&) = delete;
689  atomic& operator=(const atomic&) volatile = delete;
690 
691  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
692 
693  using __base_type::operator __integral_type;
694  using __base_type::operator=;
695 
696 #if __cplusplus > 201402L
697  static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
698 #endif
699  };
700 
701  /// Explicit specialization for long.
702  template<>
703  struct atomic<long> : __atomic_base<long>
704  {
705  typedef long __integral_type;
707 
708  atomic() noexcept = default;
709  ~atomic() noexcept = default;
710  atomic(const atomic&) = delete;
711  atomic& operator=(const atomic&) = delete;
712  atomic& operator=(const atomic&) volatile = delete;
713 
714  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
715 
716  using __base_type::operator __integral_type;
717  using __base_type::operator=;
718 
719 #if __cplusplus > 201402L
720  static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
721 #endif
722  };
723 
724  /// Explicit specialization for unsigned long.
725  template<>
726  struct atomic<unsigned long> : __atomic_base<unsigned long>
727  {
728  typedef unsigned long __integral_type;
730 
731  atomic() noexcept = default;
732  ~atomic() noexcept = default;
733  atomic(const atomic&) = delete;
734  atomic& operator=(const atomic&) = delete;
735  atomic& operator=(const atomic&) volatile = delete;
736 
737  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
738 
739  using __base_type::operator __integral_type;
740  using __base_type::operator=;
741 
742 #if __cplusplus > 201402L
743  static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
744 #endif
745  };
746 
747  /// Explicit specialization for long long.
748  template<>
749  struct atomic<long long> : __atomic_base<long long>
750  {
751  typedef long long __integral_type;
753 
754  atomic() noexcept = default;
755  ~atomic() noexcept = default;
756  atomic(const atomic&) = delete;
757  atomic& operator=(const atomic&) = delete;
758  atomic& operator=(const atomic&) volatile = delete;
759 
760  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
761 
762  using __base_type::operator __integral_type;
763  using __base_type::operator=;
764 
765 #if __cplusplus > 201402L
766  static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
767 #endif
768  };
769 
770  /// Explicit specialization for unsigned long long.
771  template<>
772  struct atomic<unsigned long long> : __atomic_base<unsigned long long>
773  {
774  typedef unsigned long long __integral_type;
776 
777  atomic() noexcept = default;
778  ~atomic() noexcept = default;
779  atomic(const atomic&) = delete;
780  atomic& operator=(const atomic&) = delete;
781  atomic& operator=(const atomic&) volatile = delete;
782 
783  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
784 
785  using __base_type::operator __integral_type;
786  using __base_type::operator=;
787 
788 #if __cplusplus > 201402L
789  static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
790 #endif
791  };
792 
793  /// Explicit specialization for wchar_t.
794  template<>
795  struct atomic<wchar_t> : __atomic_base<wchar_t>
796  {
797  typedef wchar_t __integral_type;
799 
800  atomic() noexcept = default;
801  ~atomic() noexcept = default;
802  atomic(const atomic&) = delete;
803  atomic& operator=(const atomic&) = delete;
804  atomic& operator=(const atomic&) volatile = delete;
805 
806  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
807 
808  using __base_type::operator __integral_type;
809  using __base_type::operator=;
810 
811 #if __cplusplus > 201402L
812  static constexpr bool is_always_lock_free = ATOMIC_WCHAR_T_LOCK_FREE == 2;
813 #endif
814  };
815 
816  /// Explicit specialization for char16_t.
817  template<>
818  struct atomic<char16_t> : __atomic_base<char16_t>
819  {
820  typedef char16_t __integral_type;
822 
823  atomic() noexcept = default;
824  ~atomic() noexcept = default;
825  atomic(const atomic&) = delete;
826  atomic& operator=(const atomic&) = delete;
827  atomic& operator=(const atomic&) volatile = delete;
828 
829  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
830 
831  using __base_type::operator __integral_type;
832  using __base_type::operator=;
833 
834 #if __cplusplus > 201402L
835  static constexpr bool is_always_lock_free = ATOMIC_CHAR16_T_LOCK_FREE == 2;
836 #endif
837  };
838 
839  /// Explicit specialization for char32_t.
840  template<>
841  struct atomic<char32_t> : __atomic_base<char32_t>
842  {
843  typedef char32_t __integral_type;
845 
846  atomic() noexcept = default;
847  ~atomic() noexcept = default;
848  atomic(const atomic&) = delete;
849  atomic& operator=(const atomic&) = delete;
850  atomic& operator=(const atomic&) volatile = delete;
851 
852  constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
853 
854  using __base_type::operator __integral_type;
855  using __base_type::operator=;
856 
857 #if __cplusplus > 201402L
858  static constexpr bool is_always_lock_free = ATOMIC_CHAR32_T_LOCK_FREE == 2;
859 #endif
860  };
861 
862 
863  /// atomic_bool
865 
866  /// atomic_char
868 
869  /// atomic_schar
871 
872  /// atomic_uchar
874 
875  /// atomic_short
877 
878  /// atomic_ushort
880 
881  /// atomic_int
883 
884  /// atomic_uint
886 
887  /// atomic_long
889 
890  /// atomic_ulong
892 
893  /// atomic_llong
895 
896  /// atomic_ullong
898 
899  /// atomic_wchar_t
901 
902  /// atomic_char16_t
904 
905  /// atomic_char32_t
907 
908 
909  // _GLIBCXX_RESOLVE_LIB_DEFECTS
910  // 2441. Exact-width atomic typedefs should be provided
911 
912  /// atomic_int8_t
914 
915  /// atomic_uint8_t
917 
918  /// atomic_int16_t
920 
921  /// atomic_uint16_t
923 
924  /// atomic_int32_t
926 
927  /// atomic_uint32_t
929 
930  /// atomic_int64_t
932 
933  /// atomic_uint64_t
935 
936 
937  /// atomic_int_least8_t
939 
940  /// atomic_uint_least8_t
942 
943  /// atomic_int_least16_t
945 
946  /// atomic_uint_least16_t
948 
949  /// atomic_int_least32_t
951 
952  /// atomic_uint_least32_t
954 
955  /// atomic_int_least64_t
957 
958  /// atomic_uint_least64_t
960 
961 
962  /// atomic_int_fast8_t
964 
965  /// atomic_uint_fast8_t
967 
968  /// atomic_int_fast16_t
970 
971  /// atomic_uint_fast16_t
973 
974  /// atomic_int_fast32_t
976 
977  /// atomic_uint_fast32_t
979 
980  /// atomic_int_fast64_t
982 
983  /// atomic_uint_fast64_t
985 
986 
987  /// atomic_intptr_t
989 
990  /// atomic_uintptr_t
992 
993  /// atomic_size_t
995 
996  /// atomic_intmax_t
998 
999  /// atomic_uintmax_t
1001 
1002  /// atomic_ptrdiff_t
1004 
1005 
1006  // Function definitions, atomic_flag operations.
1007  inline bool
1008  atomic_flag_test_and_set_explicit(atomic_flag* __a,
1009  memory_order __m) noexcept
1010  { return __a->test_and_set(__m); }
1011 
1012  inline bool
1013  atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
1014  memory_order __m) noexcept
1015  { return __a->test_and_set(__m); }
1016 
1017  inline void
1018  atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
1019  { __a->clear(__m); }
1020 
1021  inline void
1022  atomic_flag_clear_explicit(volatile atomic_flag* __a,
1023  memory_order __m) noexcept
1024  { __a->clear(__m); }
1025 
1026  inline bool
1027  atomic_flag_test_and_set(atomic_flag* __a) noexcept
1028  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
1029 
1030  inline bool
1031  atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
1032  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
1033 
1034  inline void
1035  atomic_flag_clear(atomic_flag* __a) noexcept
1036  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
1037 
1038  inline void
1039  atomic_flag_clear(volatile atomic_flag* __a) noexcept
1040  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
1041 
1042 
1043  // Function templates generally applicable to atomic types.
1044  template<typename _ITp>
1045  inline bool
1046  atomic_is_lock_free(const atomic<_ITp>* __a) noexcept
1047  { return __a->is_lock_free(); }
1048 
1049  template<typename _ITp>
1050  inline bool
1051  atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept
1052  { return __a->is_lock_free(); }
1053 
1054  template<typename _ITp>
1055  inline void
1056  atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept
1057  { __a->store(__i, memory_order_relaxed); }
1058 
1059  template<typename _ITp>
1060  inline void
1061  atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept
1062  { __a->store(__i, memory_order_relaxed); }
1063 
1064  template<typename _ITp>
1065  inline void
1066  atomic_store_explicit(atomic<_ITp>* __a, _ITp __i,
1067  memory_order __m) noexcept
1068  { __a->store(__i, __m); }
1069 
1070  template<typename _ITp>
1071  inline void
1072  atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i,
1073  memory_order __m) noexcept
1074  { __a->store(__i, __m); }
1075 
1076  template<typename _ITp>
1077  inline _ITp
1078  atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept
1079  { return __a->load(__m); }
1080 
1081  template<typename _ITp>
1082  inline _ITp
1083  atomic_load_explicit(const volatile atomic<_ITp>* __a,
1084  memory_order __m) noexcept
1085  { return __a->load(__m); }
1086 
1087  template<typename _ITp>
1088  inline _ITp
1089  atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i,
1090  memory_order __m) noexcept
1091  { return __a->exchange(__i, __m); }
1092 
1093  template<typename _ITp>
1094  inline _ITp
1095  atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i,
1096  memory_order __m) noexcept
1097  { return __a->exchange(__i, __m); }
1098 
1099  template<typename _ITp>
1100  inline bool
1101  atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a,
1102  _ITp* __i1, _ITp __i2,
1103  memory_order __m1,
1104  memory_order __m2) noexcept
1105  { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
1106 
1107  template<typename _ITp>
1108  inline bool
1109  atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a,
1110  _ITp* __i1, _ITp __i2,
1111  memory_order __m1,
1112  memory_order __m2) noexcept
1113  { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
1114 
1115  template<typename _ITp>
1116  inline bool
1117  atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a,
1118  _ITp* __i1, _ITp __i2,
1119  memory_order __m1,
1120  memory_order __m2) noexcept
1121  { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
1122 
1123  template<typename _ITp>
1124  inline bool
1125  atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a,
1126  _ITp* __i1, _ITp __i2,
1127  memory_order __m1,
1128  memory_order __m2) noexcept
1129  { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
1130 
1131 
1132  template<typename _ITp>
1133  inline void
1134  atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept
1135  { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
1136 
1137  template<typename _ITp>
1138  inline void
1139  atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept
1140  { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
1141 
1142  template<typename _ITp>
1143  inline _ITp
1144  atomic_load(const atomic<_ITp>* __a) noexcept
1145  { return atomic_load_explicit(__a, memory_order_seq_cst); }
1146 
1147  template<typename _ITp>
1148  inline _ITp
1149  atomic_load(const volatile atomic<_ITp>* __a) noexcept
1150  { return atomic_load_explicit(__a, memory_order_seq_cst); }
1151 
1152  template<typename _ITp>
1153  inline _ITp
1154  atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept
1155  { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
1156 
1157  template<typename _ITp>
1158  inline _ITp
1159  atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept
1160  { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
1161 
1162  template<typename _ITp>
1163  inline bool
1164  atomic_compare_exchange_weak(atomic<_ITp>* __a,
1165  _ITp* __i1, _ITp __i2) noexcept
1166  {
1167  return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
1168  memory_order_seq_cst,
1169  memory_order_seq_cst);
1170  }
1171 
1172  template<typename _ITp>
1173  inline bool
1174  atomic_compare_exchange_weak(volatile atomic<_ITp>* __a,
1175  _ITp* __i1, _ITp __i2) noexcept
1176  {
1177  return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
1178  memory_order_seq_cst,
1179  memory_order_seq_cst);
1180  }
1181 
1182  template<typename _ITp>
1183  inline bool
1184  atomic_compare_exchange_strong(atomic<_ITp>* __a,
1185  _ITp* __i1, _ITp __i2) noexcept
1186  {
1187  return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
1188  memory_order_seq_cst,
1189  memory_order_seq_cst);
1190  }
1191 
1192  template<typename _ITp>
1193  inline bool
1194  atomic_compare_exchange_strong(volatile atomic<_ITp>* __a,
1195  _ITp* __i1, _ITp __i2) noexcept
1196  {
1197  return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
1198  memory_order_seq_cst,
1199  memory_order_seq_cst);
1200  }
1201 
1202  // Function templates for atomic_integral operations only, using
1203  // __atomic_base. Template argument should be constricted to
1204  // intergral types as specified in the standard, excluding address
1205  // types.
1206  template<typename _ITp>
1207  inline _ITp
1208  atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i,
1209  memory_order __m) noexcept
1210  { return __a->fetch_add(__i, __m); }
1211 
1212  template<typename _ITp>
1213  inline _ITp
1214  atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
1215  memory_order __m) noexcept
1216  { return __a->fetch_add(__i, __m); }
1217 
1218  template<typename _ITp>
1219  inline _ITp
1220  atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i,
1221  memory_order __m) noexcept
1222  { return __a->fetch_sub(__i, __m); }
1223 
1224  template<typename _ITp>
1225  inline _ITp
1226  atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
1227  memory_order __m) noexcept
1228  { return __a->fetch_sub(__i, __m); }
1229 
1230  template<typename _ITp>
1231  inline _ITp
1232  atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i,
1233  memory_order __m) noexcept
1234  { return __a->fetch_and(__i, __m); }
1235 
1236  template<typename _ITp>
1237  inline _ITp
1238  atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
1239  memory_order __m) noexcept
1240  { return __a->fetch_and(__i, __m); }
1241 
1242  template<typename _ITp>
1243  inline _ITp
1244  atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i,
1245  memory_order __m) noexcept
1246  { return __a->fetch_or(__i, __m); }
1247 
1248  template<typename _ITp>
1249  inline _ITp
1250  atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
1251  memory_order __m) noexcept
1252  { return __a->fetch_or(__i, __m); }
1253 
1254  template<typename _ITp>
1255  inline _ITp
1256  atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i,
1257  memory_order __m) noexcept
1258  { return __a->fetch_xor(__i, __m); }
1259 
1260  template<typename _ITp>
1261  inline _ITp
1262  atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
1263  memory_order __m) noexcept
1264  { return __a->fetch_xor(__i, __m); }
1265 
1266  template<typename _ITp>
1267  inline _ITp
1268  atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept
1269  { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
1270 
1271  template<typename _ITp>
1272  inline _ITp
1273  atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
1274  { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
1275 
1276  template<typename _ITp>
1277  inline _ITp
1278  atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept
1279  { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
1280 
1281  template<typename _ITp>
1282  inline _ITp
1283  atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
1284  { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
1285 
1286  template<typename _ITp>
1287  inline _ITp
1288  atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept
1289  { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
1290 
1291  template<typename _ITp>
1292  inline _ITp
1293  atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
1294  { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
1295 
1296  template<typename _ITp>
1297  inline _ITp
1298  atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept
1299  { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
1300 
1301  template<typename _ITp>
1302  inline _ITp
1303  atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
1304  { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
1305 
1306  template<typename _ITp>
1307  inline _ITp
1308  atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept
1309  { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
1310 
1311  template<typename _ITp>
1312  inline _ITp
1313  atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
1314  { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
1315 
1316 
1317  // Partial specializations for pointers.
1318  template<typename _ITp>
1319  inline _ITp*
1320  atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
1321  memory_order __m) noexcept
1322  { return __a->fetch_add(__d, __m); }
1323 
1324  template<typename _ITp>
1325  inline _ITp*
1326  atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d,
1327  memory_order __m) noexcept
1328  { return __a->fetch_add(__d, __m); }
1329 
1330  template<typename _ITp>
1331  inline _ITp*
1332  atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
1333  { return __a->fetch_add(__d); }
1334 
1335  template<typename _ITp>
1336  inline _ITp*
1337  atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
1338  { return __a->fetch_add(__d); }
1339 
1340  template<typename _ITp>
1341  inline _ITp*
1342  atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a,
1343  ptrdiff_t __d, memory_order __m) noexcept
1344  { return __a->fetch_sub(__d, __m); }
1345 
1346  template<typename _ITp>
1347  inline _ITp*
1348  atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
1349  memory_order __m) noexcept
1350  { return __a->fetch_sub(__d, __m); }
1351 
1352  template<typename _ITp>
1353  inline _ITp*
1354  atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
1355  { return __a->fetch_sub(__d); }
1356 
1357  template<typename _ITp>
1358  inline _ITp*
1359  atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
1360  { return __a->fetch_sub(__d); }
1361  // @} group atomics
1362 
1363 _GLIBCXX_END_NAMESPACE_VERSION
1364 } // namespace
1365 
1366 #endif // C++11
1367 
1368 #endif // _GLIBCXX_ATOMIC
atomic< int_fast32_t > atomic_int_fast32_t
atomic_int_fast32_t
Definition: atomic:975
Explicit specialization for char16_t.
Definition: atomic:818
atomic< int64_t > atomic_int64_t
atomic_int64_t
Definition: atomic:931
atomic< uint_fast16_t > atomic_uint_fast16_t
atomic_uint_fast16_t
Definition: atomic:972
atomic< long long > atomic_llong
atomic_llong
Definition: atomic:894
Explicit specialization for unsigned short.
Definition: atomic:634
Explicit specialization for signed char.
Definition: atomic:565
atomic< uint_least32_t > atomic_uint_least32_t
atomic_uint_least32_t
Definition: atomic:953
atomic<bool>
Definition: atomic:63
atomic< int8_t > atomic_int8_t
atomic_int8_t
Definition: atomic:913
atomic< int_least8_t > atomic_int_least8_t
atomic_int_least8_t
Definition: atomic:938
atomic< uint_least64_t > atomic_uint_least64_t
atomic_uint_least64_t
Definition: atomic:959
atomic_flag
Definition: atomic_base.h:160
atomic< int16_t > atomic_int16_t
atomic_int16_t
Definition: atomic:919
Explicit specialization for long long.
Definition: atomic:749
atomic< ptrdiff_t > atomic_ptrdiff_t
atomic_ptrdiff_t
Definition: atomic:1003
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
Definition: move.h:47
Explicit specialization for unsigned int.
Definition: atomic:680
Explicit specialization for short.
Definition: atomic:611
ISO C++ entities toplevel namespace is std.
atomic< intptr_t > atomic_intptr_t
atomic_intptr_t
Definition: atomic:988
Explicit specialization for wchar_t.
Definition: atomic:795
atomic< signed char > atomic_schar
atomic_schar
Definition: atomic:870
atomic< uint_fast32_t > atomic_uint_fast32_t
atomic_uint_fast32_t
Definition: atomic:978
atomic< int_least64_t > atomic_int_least64_t
atomic_int_least64_t
Definition: atomic:956
Explicit specialization for unsigned long.
Definition: atomic:726
atomic< uint32_t > atomic_uint32_t
atomic_uint32_t
Definition: atomic:928
_Tp exchange(_Tp &__obj, _Up &&__new_val)
Assign __new_val to __obj and return its previous value.
Definition: utility:264
atomic< unsigned long > atomic_ulong
atomic_ulong
Definition: atomic:891
atomic< uint_fast8_t > atomic_uint_fast8_t
atomic_uint_fast8_t
Definition: atomic:966
atomic< char16_t > atomic_char16_t
atomic_char16_t
Definition: atomic:903
atomic< uintmax_t > atomic_uintmax_t
atomic_uintmax_t
Definition: atomic:1000
Explicit specialization for char32_t.
Definition: atomic:841
atomic< uint_least8_t > atomic_uint_least8_t
atomic_uint_least8_t
Definition: atomic:941
atomic< long > atomic_long
atomic_long
Definition: atomic:888
atomic< unsigned char > atomic_uchar
atomic_uchar
Definition: atomic:873
atomic< int_least16_t > atomic_int_least16_t
atomic_int_least16_t
Definition: atomic:944
atomic< unsigned short > atomic_ushort
atomic_ushort
Definition: atomic:879
atomic< int > atomic_int
atomic_int
Definition: atomic:882
atomic< int32_t > atomic_int32_t
atomic_int32_t
Definition: atomic:925
atomic< unsigned int > atomic_uint
atomic_uint
Definition: atomic:885
atomic< int_fast64_t > atomic_int_fast64_t
atomic_int_fast64_t
Definition: atomic:981
atomic< uint64_t > atomic_uint64_t
atomic_uint64_t
Definition: atomic:934
#define ATOMIC_BOOL_LOCK_FREE
atomic< uint8_t > atomic_uint8_t
atomic_uint8_t
Definition: atomic:916
atomic< uint_least16_t > atomic_uint_least16_t
atomic_uint_least16_t
Definition: atomic:947
atomic< bool > atomic_bool
atomic_bool
Definition: atomic:864
atomic< intmax_t > atomic_intmax_t
atomic_intmax_t
Definition: atomic:997
atomic< wchar_t > atomic_wchar_t
atomic_wchar_t
Definition: atomic:900
atomic< size_t > atomic_size_t
atomic_size_t
Definition: atomic:994
Explicit specialization for char.
Definition: atomic:542
Generic atomic type, primary class template.
Definition: atomic:58
atomic< uintptr_t > atomic_uintptr_t
atomic_uintptr_t
Definition: atomic:991
Explicit specialization for int.
Definition: atomic:657
Explicit specialization for unsigned char.
Definition: atomic:588
atomic< int_fast8_t > atomic_int_fast8_t
atomic_int_fast8_t
Definition: atomic:963
atomic< int_fast16_t > atomic_int_fast16_t
atomic_int_fast16_t
Definition: atomic:969
atomic< char > atomic_char
atomic_char
Definition: atomic:867
atomic< unsigned long long > atomic_ullong
atomic_ullong
Definition: atomic:897
memory_order
Enumeration for memory_order.
Definition: atomic_base.h:55
atomic< uint_fast64_t > atomic_uint_fast64_t
atomic_uint_fast64_t
Definition: atomic:984
Explicit specialization for unsigned long long.
Definition: atomic:772
atomic< int_least32_t > atomic_int_least32_t
atomic_int_least32_t
Definition: atomic:950
Explicit specialization for long.
Definition: atomic:703
atomic< short > atomic_short
atomic_short
Definition: atomic:876
atomic< uint16_t > atomic_uint16_t
atomic_uint16_t
Definition: atomic:922
atomic< char32_t > atomic_char32_t
atomic_char32_t
Definition: atomic:906