3 * @brief Common header for C11/C++11 atomics
5 * Note that some features are unavailable, as they require support from a true
9 #ifndef __IMPATOMIC_H__
10 #define __IMPATOMIC_H__
12 #include "memoryorder.h"
13 #include "cmodelint.h"
21 #define CPP0X( feature )
23 typedef struct atomic_flag
26 bool test_and_set( memory_order = memory_order_seq_cst ) volatile;
27 void clear( memory_order = memory_order_seq_cst ) volatile;
29 CPP0X( atomic_flag() = default; )
30 CPP0X( atomic_flag( const atomic_flag& ) = delete; )
31 atomic_flag& operator =( const atomic_flag& ) CPP0X(=delete);
38 #define ATOMIC_FLAG_INIT { false }
44 extern bool atomic_flag_test_and_set( volatile atomic_flag* );
45 extern bool atomic_flag_test_and_set_explicit
46 ( volatile atomic_flag*, memory_order );
47 extern void atomic_flag_clear( volatile atomic_flag* );
48 extern void atomic_flag_clear_explicit
49 ( volatile atomic_flag*, memory_order );
50 extern void __atomic_flag_wait__
51 ( volatile atomic_flag* );
52 extern void __atomic_flag_wait_explicit__
53 ( volatile atomic_flag*, memory_order );
61 inline bool atomic_flag::test_and_set( memory_order __x__ ) volatile
62 { return atomic_flag_test_and_set_explicit( this, __x__ ); }
64 inline void atomic_flag::clear( memory_order __x__ ) volatile
65 { atomic_flag_clear_explicit( this, __x__ ); }
71 The remainder of the example implementation uses the following
72 macros. These macros exploit GNU extensions for value-returning
73 blocks (AKA statement expressions) and __typeof__.
75 The macros rely on data fields of atomic structs being named __f__.
76 Other symbols used are __a__=atomic, __e__=expected, __f__=field,
77 __g__=flag, __m__=modified, __o__=operation, __r__=result,
78 __p__=pointer to field, __v__=value (for single evaluation),
79 __x__=memory-ordering, and __y__=memory-ordering.
82 #define _ATOMIC_LOAD_( __a__, __x__ ) \
83 ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__); \
84 __typeof__((__a__)->__f__) __r__ = (__typeof__((__a__)->__f__))model_read_action((void *)__p__, __x__); \
87 #define _ATOMIC_STORE_( __a__, __m__, __x__ ) \
88 ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__); \
89 __typeof__(__m__) __v__ = (__m__); \
90 model_write_action((void *) __p__, __x__, (uint64_t) __v__); \
91 __v__ = __v__; /* Silence clang (-Wunused-value) */ \
95 #define _ATOMIC_INIT_( __a__, __m__ ) \
96 ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__); \
97 __typeof__(__m__) __v__ = (__m__); \
98 model_init_action((void *) __p__, (uint64_t) __v__); \
99 __v__ = __v__; /* Silence clang (-Wunused-value) */ \
102 #define _ATOMIC_MODIFY_( __a__, __o__, __m__, __x__ ) \
103 ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__); \
104 __typeof__((__a__)->__f__) __old__=(__typeof__((__a__)->__f__)) model_rmwr_action((void *)__p__, __x__); \
105 __typeof__(__m__) __v__ = (__m__); \
106 __typeof__((__a__)->__f__) __copy__= __old__; \
107 __copy__ __o__ __v__; \
108 model_rmw_action((void *)__p__, __x__, (uint64_t) __copy__); \
109 __old__ = __old__; /* Silence clang (-Wunused-value) */ \
112 /* No spurious failure for now */
113 #define _ATOMIC_CMPSWP_WEAK_ _ATOMIC_CMPSWP_
115 #define _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ) \
116 ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__); \
117 __typeof__(__e__) __q__ = (__e__); \
118 __typeof__(__m__) __v__ = (__m__); \
120 __typeof__((__a__)->__f__) __t__=(__typeof__((__a__)->__f__)) model_rmwr_action((void *)__p__, __x__); \
121 if (__t__ == * __q__ ) { \
122 model_rmw_action((void *)__p__, __x__, (uint64_t) __v__); __r__ = true; } \
123 else { model_rmwc_action((void *)__p__, __x__); *__q__ = __t__; __r__ = false;} \
126 #define _ATOMIC_FENCE_( __x__ ) \
127 ({ model_fence_action(__x__);})
130 #define ATOMIC_CHAR_LOCK_FREE 1
131 #define ATOMIC_CHAR16_T_LOCK_FREE 1
132 #define ATOMIC_CHAR32_T_LOCK_FREE 1
133 #define ATOMIC_WCHAR_T_LOCK_FREE 1
134 #define ATOMIC_SHORT_LOCK_FREE 1
135 #define ATOMIC_INT_LOCK_FREE 1
136 #define ATOMIC_LONG_LOCK_FREE 1
137 #define ATOMIC_LLONG_LOCK_FREE 1
138 #define ATOMIC_ADDRESS_LOCK_FREE 1
140 typedef struct atomic_bool
143 bool is_lock_free() const volatile;
144 void store( bool, memory_order = memory_order_seq_cst ) volatile;
145 bool load( memory_order = memory_order_seq_cst ) volatile;
146 bool exchange( bool, memory_order = memory_order_seq_cst ) volatile;
147 bool compare_exchange_weak ( bool&, bool, memory_order, memory_order ) volatile;
148 bool compare_exchange_strong ( bool&, bool, memory_order, memory_order ) volatile;
149 bool compare_exchange_weak ( bool&, bool,
150 memory_order = memory_order_seq_cst) volatile;
151 bool compare_exchange_strong ( bool&, bool,
152 memory_order = memory_order_seq_cst) volatile;
154 CPP0X( atomic_bool() = delete; )
155 CPP0X( constexpr explicit atomic_bool( bool __v__ ) : __f__( __v__ ) { } )
156 CPP0X( atomic_bool( const atomic_bool& ) = delete; )
157 atomic_bool& operator =( const atomic_bool& ) CPP0X(=delete);
159 bool operator =( bool __v__ ) volatile
160 { store( __v__ ); return __v__; }
162 friend void atomic_store_explicit( volatile atomic_bool*, bool,
164 friend bool atomic_load_explicit( volatile atomic_bool*, memory_order );
165 friend bool atomic_exchange_explicit( volatile atomic_bool*, bool,
167 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_bool*, bool*, bool,
168 memory_order, memory_order );
169 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_bool*, bool*, bool,
170 memory_order, memory_order );
178 typedef struct atomic_address
181 bool is_lock_free() const volatile;
182 void store( void*, memory_order = memory_order_seq_cst ) volatile;
183 void* load( memory_order = memory_order_seq_cst ) volatile;
184 void* exchange( void*, memory_order = memory_order_seq_cst ) volatile;
185 bool compare_exchange_weak( void*&, void*, memory_order, memory_order ) volatile;
186 bool compare_exchange_strong( void*&, void*, memory_order, memory_order ) volatile;
187 bool compare_exchange_weak( void*&, void*,
188 memory_order = memory_order_seq_cst ) volatile;
189 bool compare_exchange_strong( void*&, void*,
190 memory_order = memory_order_seq_cst ) volatile;
191 void* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
192 void* fetch_sub( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
194 CPP0X( atomic_address() = default; )
195 CPP0X( constexpr explicit atomic_address( void* __v__ ) : __f__( __v__) { } )
196 CPP0X( atomic_address( const atomic_address& ) = delete; )
197 atomic_address& operator =( const atomic_address & ) CPP0X(=delete);
199 void* operator =( void* __v__ ) volatile
200 { store( __v__ ); return __v__; }
202 void* operator +=( ptrdiff_t __v__ ) volatile
203 { return fetch_add( __v__ ); }
205 void* operator -=( ptrdiff_t __v__ ) volatile
206 { return fetch_sub( __v__ ); }
208 friend void atomic_store_explicit( volatile atomic_address*, void*,
210 friend void* atomic_load_explicit( volatile atomic_address*, memory_order );
211 friend void* atomic_exchange_explicit( volatile atomic_address*, void*,
213 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_address*,
214 void**, void*, memory_order, memory_order );
215 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_address*,
216 void**, void*, memory_order, memory_order );
217 friend void* atomic_fetch_add_explicit( volatile atomic_address*, ptrdiff_t,
219 friend void* atomic_fetch_sub_explicit( volatile atomic_address*, ptrdiff_t,
228 typedef struct atomic_char
231 bool is_lock_free() const volatile;
233 memory_order = memory_order_seq_cst ) volatile;
234 char load( memory_order = memory_order_seq_cst ) volatile;
236 memory_order = memory_order_seq_cst ) volatile;
237 bool compare_exchange_weak( char&, char,
238 memory_order, memory_order ) volatile;
239 bool compare_exchange_strong( char&, char,
240 memory_order, memory_order ) volatile;
241 bool compare_exchange_weak( char&, char,
242 memory_order = memory_order_seq_cst ) volatile;
243 bool compare_exchange_strong( char&, char,
244 memory_order = memory_order_seq_cst ) volatile;
245 char fetch_add( char,
246 memory_order = memory_order_seq_cst ) volatile;
247 char fetch_sub( char,
248 memory_order = memory_order_seq_cst ) volatile;
249 char fetch_and( char,
250 memory_order = memory_order_seq_cst ) volatile;
252 memory_order = memory_order_seq_cst ) volatile;
253 char fetch_xor( char,
254 memory_order = memory_order_seq_cst ) volatile;
256 CPP0X( atomic_char() = default; )
257 CPP0X( constexpr atomic_char( char __v__ ) : __f__( __v__) { } )
258 CPP0X( atomic_char( const atomic_char& ) = delete; )
259 atomic_char& operator =( const atomic_char& ) CPP0X(=delete);
261 char operator =( char __v__ ) volatile
262 { store( __v__ ); return __v__; }
264 char operator ++( int ) volatile
265 { return fetch_add( 1 ); }
267 char operator --( int ) volatile
268 { return fetch_sub( 1 ); }
270 char operator ++() volatile
271 { return fetch_add( 1 ) + 1; }
273 char operator --() volatile
274 { return fetch_sub( 1 ) - 1; }
276 char operator +=( char __v__ ) volatile
277 { return fetch_add( __v__ ) + __v__; }
279 char operator -=( char __v__ ) volatile
280 { return fetch_sub( __v__ ) - __v__; }
282 char operator &=( char __v__ ) volatile
283 { return fetch_and( __v__ ) & __v__; }
285 char operator |=( char __v__ ) volatile
286 { return fetch_or( __v__ ) | __v__; }
288 char operator ^=( char __v__ ) volatile
289 { return fetch_xor( __v__ ) ^ __v__; }
291 friend void atomic_store_explicit( volatile atomic_char*, char,
293 friend char atomic_load_explicit( volatile atomic_char*,
295 friend char atomic_exchange_explicit( volatile atomic_char*,
296 char, memory_order );
297 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_char*,
298 char*, char, memory_order, memory_order );
299 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_char*,
300 char*, char, memory_order, memory_order );
301 friend char atomic_fetch_add_explicit( volatile atomic_char*,
302 char, memory_order );
303 friend char atomic_fetch_sub_explicit( volatile atomic_char*,
304 char, memory_order );
305 friend char atomic_fetch_and_explicit( volatile atomic_char*,
306 char, memory_order );
307 friend char atomic_fetch_or_explicit( volatile atomic_char*,
308 char, memory_order );
309 friend char atomic_fetch_xor_explicit( volatile atomic_char*,
310 char, memory_order );
318 typedef struct atomic_schar
321 bool is_lock_free() const volatile;
322 void store( signed char,
323 memory_order = memory_order_seq_cst ) volatile;
324 signed char load( memory_order = memory_order_seq_cst ) volatile;
325 signed char exchange( signed char,
326 memory_order = memory_order_seq_cst ) volatile;
327 bool compare_exchange_weak( signed char&, signed char,
328 memory_order, memory_order ) volatile;
329 bool compare_exchange_strong( signed char&, signed char,
330 memory_order, memory_order ) volatile;
331 bool compare_exchange_weak( signed char&, signed char,
332 memory_order = memory_order_seq_cst ) volatile;
333 bool compare_exchange_strong( signed char&, signed char,
334 memory_order = memory_order_seq_cst ) volatile;
335 signed char fetch_add( signed char,
336 memory_order = memory_order_seq_cst ) volatile;
337 signed char fetch_sub( signed char,
338 memory_order = memory_order_seq_cst ) volatile;
339 signed char fetch_and( signed char,
340 memory_order = memory_order_seq_cst ) volatile;
341 signed char fetch_or( signed char,
342 memory_order = memory_order_seq_cst ) volatile;
343 signed char fetch_xor( signed char,
344 memory_order = memory_order_seq_cst ) volatile;
346 CPP0X( atomic_schar() = default; )
347 CPP0X( constexpr atomic_schar( signed char __v__ ) : __f__( __v__) { } )
348 CPP0X( atomic_schar( const atomic_schar& ) = delete; )
349 atomic_schar& operator =( const atomic_schar& ) CPP0X(=delete);
351 signed char operator =( signed char __v__ ) volatile
352 { store( __v__ ); return __v__; }
354 signed char operator ++( int ) volatile
355 { return fetch_add( 1 ); }
357 signed char operator --( int ) volatile
358 { return fetch_sub( 1 ); }
360 signed char operator ++() volatile
361 { return fetch_add( 1 ) + 1; }
363 signed char operator --() volatile
364 { return fetch_sub( 1 ) - 1; }
366 signed char operator +=( signed char __v__ ) volatile
367 { return fetch_add( __v__ ) + __v__; }
369 signed char operator -=( signed char __v__ ) volatile
370 { return fetch_sub( __v__ ) - __v__; }
372 signed char operator &=( signed char __v__ ) volatile
373 { return fetch_and( __v__ ) & __v__; }
375 signed char operator |=( signed char __v__ ) volatile
376 { return fetch_or( __v__ ) | __v__; }
378 signed char operator ^=( signed char __v__ ) volatile
379 { return fetch_xor( __v__ ) ^ __v__; }
381 friend void atomic_store_explicit( volatile atomic_schar*, signed char,
383 friend signed char atomic_load_explicit( volatile atomic_schar*,
385 friend signed char atomic_exchange_explicit( volatile atomic_schar*,
386 signed char, memory_order );
387 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_schar*,
388 signed char*, signed char, memory_order, memory_order );
389 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_schar*,
390 signed char*, signed char, memory_order, memory_order );
391 friend signed char atomic_fetch_add_explicit( volatile atomic_schar*,
392 signed char, memory_order );
393 friend signed char atomic_fetch_sub_explicit( volatile atomic_schar*,
394 signed char, memory_order );
395 friend signed char atomic_fetch_and_explicit( volatile atomic_schar*,
396 signed char, memory_order );
397 friend signed char atomic_fetch_or_explicit( volatile atomic_schar*,
398 signed char, memory_order );
399 friend signed char atomic_fetch_xor_explicit( volatile atomic_schar*,
400 signed char, memory_order );
408 typedef struct atomic_uchar
411 bool is_lock_free() const volatile;
412 void store( unsigned char,
413 memory_order = memory_order_seq_cst ) volatile;
414 unsigned char load( memory_order = memory_order_seq_cst ) volatile;
415 unsigned char exchange( unsigned char,
416 memory_order = memory_order_seq_cst ) volatile;
417 bool compare_exchange_weak( unsigned char&, unsigned char,
418 memory_order, memory_order ) volatile;
419 bool compare_exchange_strong( unsigned char&, unsigned char,
420 memory_order, memory_order ) volatile;
421 bool compare_exchange_weak( unsigned char&, unsigned char,
422 memory_order = memory_order_seq_cst ) volatile;
423 bool compare_exchange_strong( unsigned char&, unsigned char,
424 memory_order = memory_order_seq_cst ) volatile;
425 unsigned char fetch_add( unsigned char,
426 memory_order = memory_order_seq_cst ) volatile;
427 unsigned char fetch_sub( unsigned char,
428 memory_order = memory_order_seq_cst ) volatile;
429 unsigned char fetch_and( unsigned char,
430 memory_order = memory_order_seq_cst ) volatile;
431 unsigned char fetch_or( unsigned char,
432 memory_order = memory_order_seq_cst ) volatile;
433 unsigned char fetch_xor( unsigned char,
434 memory_order = memory_order_seq_cst ) volatile;
436 CPP0X( atomic_uchar() = default; )
437 CPP0X( constexpr atomic_uchar( unsigned char __v__ ) : __f__( __v__) { } )
438 CPP0X( atomic_uchar( const atomic_uchar& ) = delete; )
439 atomic_uchar& operator =( const atomic_uchar& ) CPP0X(=delete);
441 unsigned char operator =( unsigned char __v__ ) volatile
442 { store( __v__ ); return __v__; }
444 unsigned char operator ++( int ) volatile
445 { return fetch_add( 1 ); }
447 unsigned char operator --( int ) volatile
448 { return fetch_sub( 1 ); }
450 unsigned char operator ++() volatile
451 { return fetch_add( 1 ) + 1; }
453 unsigned char operator --() volatile
454 { return fetch_sub( 1 ) - 1; }
456 unsigned char operator +=( unsigned char __v__ ) volatile
457 { return fetch_add( __v__ ) + __v__; }
459 unsigned char operator -=( unsigned char __v__ ) volatile
460 { return fetch_sub( __v__ ) - __v__; }
462 unsigned char operator &=( unsigned char __v__ ) volatile
463 { return fetch_and( __v__ ) & __v__; }
465 unsigned char operator |=( unsigned char __v__ ) volatile
466 { return fetch_or( __v__ ) | __v__; }
468 unsigned char operator ^=( unsigned char __v__ ) volatile
469 { return fetch_xor( __v__ ) ^ __v__; }
471 friend void atomic_store_explicit( volatile atomic_uchar*, unsigned char,
473 friend unsigned char atomic_load_explicit( volatile atomic_uchar*,
475 friend unsigned char atomic_exchange_explicit( volatile atomic_uchar*,
476 unsigned char, memory_order );
477 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_uchar*,
478 unsigned char*, unsigned char, memory_order, memory_order );
479 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_uchar*,
480 unsigned char*, unsigned char, memory_order, memory_order );
481 friend unsigned char atomic_fetch_add_explicit( volatile atomic_uchar*,
482 unsigned char, memory_order );
483 friend unsigned char atomic_fetch_sub_explicit( volatile atomic_uchar*,
484 unsigned char, memory_order );
485 friend unsigned char atomic_fetch_and_explicit( volatile atomic_uchar*,
486 unsigned char, memory_order );
487 friend unsigned char atomic_fetch_or_explicit( volatile atomic_uchar*,
488 unsigned char, memory_order );
489 friend unsigned char atomic_fetch_xor_explicit( volatile atomic_uchar*,
490 unsigned char, memory_order );
498 typedef struct atomic_short
501 bool is_lock_free() const volatile;
503 memory_order = memory_order_seq_cst ) volatile;
504 short load( memory_order = memory_order_seq_cst ) volatile;
505 short exchange( short,
506 memory_order = memory_order_seq_cst ) volatile;
507 bool compare_exchange_weak( short&, short,
508 memory_order, memory_order ) volatile;
509 bool compare_exchange_strong( short&, short,
510 memory_order, memory_order ) volatile;
511 bool compare_exchange_weak( short&, short,
512 memory_order = memory_order_seq_cst ) volatile;
513 bool compare_exchange_strong( short&, short,
514 memory_order = memory_order_seq_cst ) volatile;
515 short fetch_add( short,
516 memory_order = memory_order_seq_cst ) volatile;
517 short fetch_sub( short,
518 memory_order = memory_order_seq_cst ) volatile;
519 short fetch_and( short,
520 memory_order = memory_order_seq_cst ) volatile;
521 short fetch_or( short,
522 memory_order = memory_order_seq_cst ) volatile;
523 short fetch_xor( short,
524 memory_order = memory_order_seq_cst ) volatile;
526 CPP0X( atomic_short() = default; )
527 CPP0X( constexpr atomic_short( short __v__ ) : __f__( __v__) { } )
528 CPP0X( atomic_short( const atomic_short& ) = delete; )
529 atomic_short& operator =( const atomic_short& ) CPP0X(=delete);
531 short operator =( short __v__ ) volatile
532 { store( __v__ ); return __v__; }
534 short operator ++( int ) volatile
535 { return fetch_add( 1 ); }
537 short operator --( int ) volatile
538 { return fetch_sub( 1 ); }
540 short operator ++() volatile
541 { return fetch_add( 1 ) + 1; }
543 short operator --() volatile
544 { return fetch_sub( 1 ) - 1; }
546 short operator +=( short __v__ ) volatile
547 { return fetch_add( __v__ ) + __v__; }
549 short operator -=( short __v__ ) volatile
550 { return fetch_sub( __v__ ) - __v__; }
552 short operator &=( short __v__ ) volatile
553 { return fetch_and( __v__ ) & __v__; }
555 short operator |=( short __v__ ) volatile
556 { return fetch_or( __v__ ) | __v__; }
558 short operator ^=( short __v__ ) volatile
559 { return fetch_xor( __v__ ) ^ __v__; }
561 friend void atomic_store_explicit( volatile atomic_short*, short,
563 friend short atomic_load_explicit( volatile atomic_short*,
565 friend short atomic_exchange_explicit( volatile atomic_short*,
566 short, memory_order );
567 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_short*,
568 short*, short, memory_order, memory_order );
569 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_short*,
570 short*, short, memory_order, memory_order );
571 friend short atomic_fetch_add_explicit( volatile atomic_short*,
572 short, memory_order );
573 friend short atomic_fetch_sub_explicit( volatile atomic_short*,
574 short, memory_order );
575 friend short atomic_fetch_and_explicit( volatile atomic_short*,
576 short, memory_order );
577 friend short atomic_fetch_or_explicit( volatile atomic_short*,
578 short, memory_order );
579 friend short atomic_fetch_xor_explicit( volatile atomic_short*,
580 short, memory_order );
588 typedef struct atomic_ushort
591 bool is_lock_free() const volatile;
592 void store( unsigned short,
593 memory_order = memory_order_seq_cst ) volatile;
594 unsigned short load( memory_order = memory_order_seq_cst ) volatile;
595 unsigned short exchange( unsigned short,
596 memory_order = memory_order_seq_cst ) volatile;
597 bool compare_exchange_weak( unsigned short&, unsigned short,
598 memory_order, memory_order ) volatile;
599 bool compare_exchange_strong( unsigned short&, unsigned short,
600 memory_order, memory_order ) volatile;
601 bool compare_exchange_weak( unsigned short&, unsigned short,
602 memory_order = memory_order_seq_cst ) volatile;
603 bool compare_exchange_strong( unsigned short&, unsigned short,
604 memory_order = memory_order_seq_cst ) volatile;
605 unsigned short fetch_add( unsigned short,
606 memory_order = memory_order_seq_cst ) volatile;
607 unsigned short fetch_sub( unsigned short,
608 memory_order = memory_order_seq_cst ) volatile;
609 unsigned short fetch_and( unsigned short,
610 memory_order = memory_order_seq_cst ) volatile;
611 unsigned short fetch_or( unsigned short,
612 memory_order = memory_order_seq_cst ) volatile;
613 unsigned short fetch_xor( unsigned short,
614 memory_order = memory_order_seq_cst ) volatile;
616 CPP0X( atomic_ushort() = default; )
617 CPP0X( constexpr atomic_ushort( unsigned short __v__ ) : __f__( __v__) { } )
618 CPP0X( atomic_ushort( const atomic_ushort& ) = delete; )
619 atomic_ushort& operator =( const atomic_ushort& ) CPP0X(=delete);
621 unsigned short operator =( unsigned short __v__ ) volatile
622 { store( __v__ ); return __v__; }
624 unsigned short operator ++( int ) volatile
625 { return fetch_add( 1 ); }
627 unsigned short operator --( int ) volatile
628 { return fetch_sub( 1 ); }
630 unsigned short operator ++() volatile
631 { return fetch_add( 1 ) + 1; }
633 unsigned short operator --() volatile
634 { return fetch_sub( 1 ) - 1; }
636 unsigned short operator +=( unsigned short __v__ ) volatile
637 { return fetch_add( __v__ ) + __v__; }
639 unsigned short operator -=( unsigned short __v__ ) volatile
640 { return fetch_sub( __v__ ) - __v__; }
642 unsigned short operator &=( unsigned short __v__ ) volatile
643 { return fetch_and( __v__ ) & __v__; }
645 unsigned short operator |=( unsigned short __v__ ) volatile
646 { return fetch_or( __v__ ) | __v__; }
648 unsigned short operator ^=( unsigned short __v__ ) volatile
649 { return fetch_xor( __v__ ) ^ __v__; }
651 friend void atomic_store_explicit( volatile atomic_ushort*, unsigned short,
653 friend unsigned short atomic_load_explicit( volatile atomic_ushort*,
655 friend unsigned short atomic_exchange_explicit( volatile atomic_ushort*,
656 unsigned short, memory_order );
657 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ushort*,
658 unsigned short*, unsigned short, memory_order, memory_order );
659 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ushort*,
660 unsigned short*, unsigned short, memory_order, memory_order );
661 friend unsigned short atomic_fetch_add_explicit( volatile atomic_ushort*,
662 unsigned short, memory_order );
663 friend unsigned short atomic_fetch_sub_explicit( volatile atomic_ushort*,
664 unsigned short, memory_order );
665 friend unsigned short atomic_fetch_and_explicit( volatile atomic_ushort*,
666 unsigned short, memory_order );
667 friend unsigned short atomic_fetch_or_explicit( volatile atomic_ushort*,
668 unsigned short, memory_order );
669 friend unsigned short atomic_fetch_xor_explicit( volatile atomic_ushort*,
670 unsigned short, memory_order );
674 unsigned short __f__;
678 typedef struct atomic_int
681 bool is_lock_free() const volatile;
683 memory_order = memory_order_seq_cst ) volatile;
684 int load( memory_order = memory_order_seq_cst ) volatile;
686 memory_order = memory_order_seq_cst ) volatile;
687 bool compare_exchange_weak( int&, int,
688 memory_order, memory_order ) volatile;
689 bool compare_exchange_strong( int&, int,
690 memory_order, memory_order ) volatile;
691 bool compare_exchange_weak( int&, int,
692 memory_order = memory_order_seq_cst ) volatile;
693 bool compare_exchange_strong( int&, int,
694 memory_order = memory_order_seq_cst ) volatile;
696 memory_order = memory_order_seq_cst ) volatile;
698 memory_order = memory_order_seq_cst ) volatile;
700 memory_order = memory_order_seq_cst ) volatile;
702 memory_order = memory_order_seq_cst ) volatile;
704 memory_order = memory_order_seq_cst ) volatile;
706 CPP0X( atomic_int() = default; )
707 CPP0X( constexpr atomic_int( int __v__ ) : __f__( __v__) { } )
708 CPP0X( atomic_int( const atomic_int& ) = delete; )
709 atomic_int& operator =( const atomic_int& ) CPP0X(=delete);
711 int operator =( int __v__ ) volatile
712 { store( __v__ ); return __v__; }
714 int operator ++( int ) volatile
715 { return fetch_add( 1 ); }
717 int operator --( int ) volatile
718 { return fetch_sub( 1 ); }
720 int operator ++() volatile
721 { return fetch_add( 1 ) + 1; }
723 int operator --() volatile
724 { return fetch_sub( 1 ) - 1; }
726 int operator +=( int __v__ ) volatile
727 { return fetch_add( __v__ ) + __v__; }
729 int operator -=( int __v__ ) volatile
730 { return fetch_sub( __v__ ) - __v__; }
732 int operator &=( int __v__ ) volatile
733 { return fetch_and( __v__ ) & __v__; }
735 int operator |=( int __v__ ) volatile
736 { return fetch_or( __v__ ) | __v__; }
738 int operator ^=( int __v__ ) volatile
739 { return fetch_xor( __v__ ) ^ __v__; }
741 friend void atomic_store_explicit( volatile atomic_int*, int,
743 friend int atomic_load_explicit( volatile atomic_int*,
745 friend int atomic_exchange_explicit( volatile atomic_int*,
747 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_int*,
748 int*, int, memory_order, memory_order );
749 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_int*,
750 int*, int, memory_order, memory_order );
751 friend int atomic_fetch_add_explicit( volatile atomic_int*,
753 friend int atomic_fetch_sub_explicit( volatile atomic_int*,
755 friend int atomic_fetch_and_explicit( volatile atomic_int*,
757 friend int atomic_fetch_or_explicit( volatile atomic_int*,
759 friend int atomic_fetch_xor_explicit( volatile atomic_int*,
768 typedef struct atomic_uint
771 bool is_lock_free() const volatile;
772 void store( unsigned int,
773 memory_order = memory_order_seq_cst ) volatile;
774 unsigned int load( memory_order = memory_order_seq_cst ) volatile;
775 unsigned int exchange( unsigned int,
776 memory_order = memory_order_seq_cst ) volatile;
777 bool compare_exchange_weak( unsigned int&, unsigned int,
778 memory_order, memory_order ) volatile;
779 bool compare_exchange_strong( unsigned int&, unsigned int,
780 memory_order, memory_order ) volatile;
781 bool compare_exchange_weak( unsigned int&, unsigned int,
782 memory_order = memory_order_seq_cst ) volatile;
783 bool compare_exchange_strong( unsigned int&, unsigned int,
784 memory_order = memory_order_seq_cst ) volatile;
785 unsigned int fetch_add( unsigned int,
786 memory_order = memory_order_seq_cst ) volatile;
787 unsigned int fetch_sub( unsigned int,
788 memory_order = memory_order_seq_cst ) volatile;
789 unsigned int fetch_and( unsigned int,
790 memory_order = memory_order_seq_cst ) volatile;
791 unsigned int fetch_or( unsigned int,
792 memory_order = memory_order_seq_cst ) volatile;
793 unsigned int fetch_xor( unsigned int,
794 memory_order = memory_order_seq_cst ) volatile;
796 CPP0X( atomic_uint() = default; )
797 CPP0X( constexpr atomic_uint( unsigned int __v__ ) : __f__( __v__) { } )
798 CPP0X( atomic_uint( const atomic_uint& ) = delete; )
799 atomic_uint& operator =( const atomic_uint& ) CPP0X(=delete);
801 unsigned int operator =( unsigned int __v__ ) volatile
802 { store( __v__ ); return __v__; }
804 unsigned int operator ++( int ) volatile
805 { return fetch_add( 1 ); }
807 unsigned int operator --( int ) volatile
808 { return fetch_sub( 1 ); }
810 unsigned int operator ++() volatile
811 { return fetch_add( 1 ) + 1; }
813 unsigned int operator --() volatile
814 { return fetch_sub( 1 ) - 1; }
816 unsigned int operator +=( unsigned int __v__ ) volatile
817 { return fetch_add( __v__ ) + __v__; }
819 unsigned int operator -=( unsigned int __v__ ) volatile
820 { return fetch_sub( __v__ ) - __v__; }
822 unsigned int operator &=( unsigned int __v__ ) volatile
823 { return fetch_and( __v__ ) & __v__; }
825 unsigned int operator |=( unsigned int __v__ ) volatile
826 { return fetch_or( __v__ ) | __v__; }
828 unsigned int operator ^=( unsigned int __v__ ) volatile
829 { return fetch_xor( __v__ ) ^ __v__; }
831 friend void atomic_store_explicit( volatile atomic_uint*, unsigned int,
833 friend unsigned int atomic_load_explicit( volatile atomic_uint*,
835 friend unsigned int atomic_exchange_explicit( volatile atomic_uint*,
836 unsigned int, memory_order );
837 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_uint*,
838 unsigned int*, unsigned int, memory_order, memory_order );
839 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_uint*,
840 unsigned int*, unsigned int, memory_order, memory_order );
841 friend unsigned int atomic_fetch_add_explicit( volatile atomic_uint*,
842 unsigned int, memory_order );
843 friend unsigned int atomic_fetch_sub_explicit( volatile atomic_uint*,
844 unsigned int, memory_order );
845 friend unsigned int atomic_fetch_and_explicit( volatile atomic_uint*,
846 unsigned int, memory_order );
847 friend unsigned int atomic_fetch_or_explicit( volatile atomic_uint*,
848 unsigned int, memory_order );
849 friend unsigned int atomic_fetch_xor_explicit( volatile atomic_uint*,
850 unsigned int, memory_order );
858 typedef struct atomic_long
861 bool is_lock_free() const volatile;
863 memory_order = memory_order_seq_cst ) volatile;
864 long load( memory_order = memory_order_seq_cst ) volatile;
866 memory_order = memory_order_seq_cst ) volatile;
867 bool compare_exchange_weak( long&, long,
868 memory_order, memory_order ) volatile;
869 bool compare_exchange_strong( long&, long,
870 memory_order, memory_order ) volatile;
871 bool compare_exchange_weak( long&, long,
872 memory_order = memory_order_seq_cst ) volatile;
873 bool compare_exchange_strong( long&, long,
874 memory_order = memory_order_seq_cst ) volatile;
875 long fetch_add( long,
876 memory_order = memory_order_seq_cst ) volatile;
877 long fetch_sub( long,
878 memory_order = memory_order_seq_cst ) volatile;
879 long fetch_and( long,
880 memory_order = memory_order_seq_cst ) volatile;
882 memory_order = memory_order_seq_cst ) volatile;
883 long fetch_xor( long,
884 memory_order = memory_order_seq_cst ) volatile;
886 CPP0X( atomic_long() = default; )
887 CPP0X( constexpr atomic_long( long __v__ ) : __f__( __v__) { } )
888 CPP0X( atomic_long( const atomic_long& ) = delete; )
889 atomic_long& operator =( const atomic_long& ) CPP0X(=delete);
891 long operator =( long __v__ ) volatile
892 { store( __v__ ); return __v__; }
894 long operator ++( int ) volatile
895 { return fetch_add( 1 ); }
897 long operator --( int ) volatile
898 { return fetch_sub( 1 ); }
900 long operator ++() volatile
901 { return fetch_add( 1 ) + 1; }
903 long operator --() volatile
904 { return fetch_sub( 1 ) - 1; }
906 long operator +=( long __v__ ) volatile
907 { return fetch_add( __v__ ) + __v__; }
909 long operator -=( long __v__ ) volatile
910 { return fetch_sub( __v__ ) - __v__; }
912 long operator &=( long __v__ ) volatile
913 { return fetch_and( __v__ ) & __v__; }
915 long operator |=( long __v__ ) volatile
916 { return fetch_or( __v__ ) | __v__; }
918 long operator ^=( long __v__ ) volatile
919 { return fetch_xor( __v__ ) ^ __v__; }
921 friend void atomic_store_explicit( volatile atomic_long*, long,
923 friend long atomic_load_explicit( volatile atomic_long*,
925 friend long atomic_exchange_explicit( volatile atomic_long*,
926 long, memory_order );
927 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_long*,
928 long*, long, memory_order, memory_order );
929 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_long*,
930 long*, long, memory_order, memory_order );
931 friend long atomic_fetch_add_explicit( volatile atomic_long*,
932 long, memory_order );
933 friend long atomic_fetch_sub_explicit( volatile atomic_long*,
934 long, memory_order );
935 friend long atomic_fetch_and_explicit( volatile atomic_long*,
936 long, memory_order );
937 friend long atomic_fetch_or_explicit( volatile atomic_long*,
938 long, memory_order );
939 friend long atomic_fetch_xor_explicit( volatile atomic_long*,
940 long, memory_order );
948 typedef struct atomic_ulong
951 bool is_lock_free() const volatile;
952 void store( unsigned long,
953 memory_order = memory_order_seq_cst ) volatile;
954 unsigned long load( memory_order = memory_order_seq_cst ) volatile;
955 unsigned long exchange( unsigned long,
956 memory_order = memory_order_seq_cst ) volatile;
957 bool compare_exchange_weak( unsigned long&, unsigned long,
958 memory_order, memory_order ) volatile;
959 bool compare_exchange_strong( unsigned long&, unsigned long,
960 memory_order, memory_order ) volatile;
961 bool compare_exchange_weak( unsigned long&, unsigned long,
962 memory_order = memory_order_seq_cst ) volatile;
963 bool compare_exchange_strong( unsigned long&, unsigned long,
964 memory_order = memory_order_seq_cst ) volatile;
965 unsigned long fetch_add( unsigned long,
966 memory_order = memory_order_seq_cst ) volatile;
967 unsigned long fetch_sub( unsigned long,
968 memory_order = memory_order_seq_cst ) volatile;
969 unsigned long fetch_and( unsigned long,
970 memory_order = memory_order_seq_cst ) volatile;
971 unsigned long fetch_or( unsigned long,
972 memory_order = memory_order_seq_cst ) volatile;
973 unsigned long fetch_xor( unsigned long,
974 memory_order = memory_order_seq_cst ) volatile;
976 CPP0X( atomic_ulong() = default; )
977 CPP0X( constexpr atomic_ulong( unsigned long __v__ ) : __f__( __v__) { } )
978 CPP0X( atomic_ulong( const atomic_ulong& ) = delete; )
979 atomic_ulong& operator =( const atomic_ulong& ) CPP0X(=delete);
981 unsigned long operator =( unsigned long __v__ ) volatile
982 { store( __v__ ); return __v__; }
984 unsigned long operator ++( int ) volatile
985 { return fetch_add( 1 ); }
987 unsigned long operator --( int ) volatile
988 { return fetch_sub( 1 ); }
990 unsigned long operator ++() volatile
991 { return fetch_add( 1 ) + 1; }
993 unsigned long operator --() volatile
994 { return fetch_sub( 1 ) - 1; }
996 unsigned long operator +=( unsigned long __v__ ) volatile
997 { return fetch_add( __v__ ) + __v__; }
999 unsigned long operator -=( unsigned long __v__ ) volatile
1000 { return fetch_sub( __v__ ) - __v__; }
1002 unsigned long operator &=( unsigned long __v__ ) volatile
1003 { return fetch_and( __v__ ) & __v__; }
1005 unsigned long operator |=( unsigned long __v__ ) volatile
1006 { return fetch_or( __v__ ) | __v__; }
1008 unsigned long operator ^=( unsigned long __v__ ) volatile
1009 { return fetch_xor( __v__ ) ^ __v__; }
1011 friend void atomic_store_explicit( volatile atomic_ulong*, unsigned long,
1013 friend unsigned long atomic_load_explicit( volatile atomic_ulong*,
1015 friend unsigned long atomic_exchange_explicit( volatile atomic_ulong*,
1016 unsigned long, memory_order );
1017 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ulong*,
1018 unsigned long*, unsigned long, memory_order, memory_order );
1019 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ulong*,
1020 unsigned long*, unsigned long, memory_order, memory_order );
1021 friend unsigned long atomic_fetch_add_explicit( volatile atomic_ulong*,
1022 unsigned long, memory_order );
1023 friend unsigned long atomic_fetch_sub_explicit( volatile atomic_ulong*,
1024 unsigned long, memory_order );
1025 friend unsigned long atomic_fetch_and_explicit( volatile atomic_ulong*,
1026 unsigned long, memory_order );
1027 friend unsigned long atomic_fetch_or_explicit( volatile atomic_ulong*,
1028 unsigned long, memory_order );
1029 friend unsigned long atomic_fetch_xor_explicit( volatile atomic_ulong*,
1030 unsigned long, memory_order );
1034 unsigned long __f__;
1038 typedef struct atomic_llong
1041 bool is_lock_free() const volatile;
1042 void store( long long,
1043 memory_order = memory_order_seq_cst ) volatile;
1044 long long load( memory_order = memory_order_seq_cst ) volatile;
1045 long long exchange( long long,
1046 memory_order = memory_order_seq_cst ) volatile;
1047 bool compare_exchange_weak( long long&, long long,
1048 memory_order, memory_order ) volatile;
1049 bool compare_exchange_strong( long long&, long long,
1050 memory_order, memory_order ) volatile;
1051 bool compare_exchange_weak( long long&, long long,
1052 memory_order = memory_order_seq_cst ) volatile;
1053 bool compare_exchange_strong( long long&, long long,
1054 memory_order = memory_order_seq_cst ) volatile;
1055 long long fetch_add( long long,
1056 memory_order = memory_order_seq_cst ) volatile;
1057 long long fetch_sub( long long,
1058 memory_order = memory_order_seq_cst ) volatile;
1059 long long fetch_and( long long,
1060 memory_order = memory_order_seq_cst ) volatile;
1061 long long fetch_or( long long,
1062 memory_order = memory_order_seq_cst ) volatile;
1063 long long fetch_xor( long long,
1064 memory_order = memory_order_seq_cst ) volatile;
1066 CPP0X( atomic_llong() = default; )
1067 CPP0X( constexpr atomic_llong( long long __v__ ) : __f__( __v__) { } )
1068 CPP0X( atomic_llong( const atomic_llong& ) = delete; )
1069 atomic_llong& operator =( const atomic_llong& ) CPP0X(=delete);
1071 long long operator =( long long __v__ ) volatile
1072 { store( __v__ ); return __v__; }
1074 long long operator ++( int ) volatile
1075 { return fetch_add( 1 ); }
1077 long long operator --( int ) volatile
1078 { return fetch_sub( 1 ); }
1080 long long operator ++() volatile
1081 { return fetch_add( 1 ) + 1; }
1083 long long operator --() volatile
1084 { return fetch_sub( 1 ) - 1; }
1086 long long operator +=( long long __v__ ) volatile
1087 { return fetch_add( __v__ ) + __v__; }
1089 long long operator -=( long long __v__ ) volatile
1090 { return fetch_sub( __v__ ) - __v__; }
1092 long long operator &=( long long __v__ ) volatile
1093 { return fetch_and( __v__ ) & __v__; }
1095 long long operator |=( long long __v__ ) volatile
1096 { return fetch_or( __v__ ) | __v__; }
1098 long long operator ^=( long long __v__ ) volatile
1099 { return fetch_xor( __v__ ) ^ __v__; }
1101 friend void atomic_store_explicit( volatile atomic_llong*, long long,
1103 friend long long atomic_load_explicit( volatile atomic_llong*,
1105 friend long long atomic_exchange_explicit( volatile atomic_llong*,
1106 long long, memory_order );
1107 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_llong*,
1108 long long*, long long, memory_order, memory_order );
1109 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_llong*,
1110 long long*, long long, memory_order, memory_order );
1111 friend long long atomic_fetch_add_explicit( volatile atomic_llong*,
1112 long long, memory_order );
1113 friend long long atomic_fetch_sub_explicit( volatile atomic_llong*,
1114 long long, memory_order );
1115 friend long long atomic_fetch_and_explicit( volatile atomic_llong*,
1116 long long, memory_order );
1117 friend long long atomic_fetch_or_explicit( volatile atomic_llong*,
1118 long long, memory_order );
1119 friend long long atomic_fetch_xor_explicit( volatile atomic_llong*,
1120 long long, memory_order );
1128 typedef struct atomic_ullong
1131 bool is_lock_free() const volatile;
1132 void store( unsigned long long,
1133 memory_order = memory_order_seq_cst ) volatile;
1134 unsigned long long load( memory_order = memory_order_seq_cst ) volatile;
1135 unsigned long long exchange( unsigned long long,
1136 memory_order = memory_order_seq_cst ) volatile;
1137 bool compare_exchange_weak( unsigned long long&, unsigned long long,
1138 memory_order, memory_order ) volatile;
1139 bool compare_exchange_strong( unsigned long long&, unsigned long long,
1140 memory_order, memory_order ) volatile;
1141 bool compare_exchange_weak( unsigned long long&, unsigned long long,
1142 memory_order = memory_order_seq_cst ) volatile;
1143 bool compare_exchange_strong( unsigned long long&, unsigned long long,
1144 memory_order = memory_order_seq_cst ) volatile;
1145 unsigned long long fetch_add( unsigned long long,
1146 memory_order = memory_order_seq_cst ) volatile;
1147 unsigned long long fetch_sub( unsigned long long,
1148 memory_order = memory_order_seq_cst ) volatile;
1149 unsigned long long fetch_and( unsigned long long,
1150 memory_order = memory_order_seq_cst ) volatile;
1151 unsigned long long fetch_or( unsigned long long,
1152 memory_order = memory_order_seq_cst ) volatile;
1153 unsigned long long fetch_xor( unsigned long long,
1154 memory_order = memory_order_seq_cst ) volatile;
1156 CPP0X( atomic_ullong() = default; )
1157 CPP0X( constexpr atomic_ullong( unsigned long long __v__ ) : __f__( __v__) { } )
1158 CPP0X( atomic_ullong( const atomic_ullong& ) = delete; )
1159 atomic_ullong& operator =( const atomic_ullong& ) CPP0X(=delete);
1161 unsigned long long operator =( unsigned long long __v__ ) volatile
1162 { store( __v__ ); return __v__; }
1164 unsigned long long operator ++( int ) volatile
1165 { return fetch_add( 1 ); }
1167 unsigned long long operator --( int ) volatile
1168 { return fetch_sub( 1 ); }
1170 unsigned long long operator ++() volatile
1171 { return fetch_add( 1 ) + 1; }
1173 unsigned long long operator --() volatile
1174 { return fetch_sub( 1 ) - 1; }
1176 unsigned long long operator +=( unsigned long long __v__ ) volatile
1177 { return fetch_add( __v__ ) + __v__; }
1179 unsigned long long operator -=( unsigned long long __v__ ) volatile
1180 { return fetch_sub( __v__ ) - __v__; }
1182 unsigned long long operator &=( unsigned long long __v__ ) volatile
1183 { return fetch_and( __v__ ) & __v__; }
1185 unsigned long long operator |=( unsigned long long __v__ ) volatile
1186 { return fetch_or( __v__ ) | __v__; }
1188 unsigned long long operator ^=( unsigned long long __v__ ) volatile
1189 { return fetch_xor( __v__ ) ^ __v__; }
1191 friend void atomic_store_explicit( volatile atomic_ullong*, unsigned long long,
1193 friend unsigned long long atomic_load_explicit( volatile atomic_ullong*,
1195 friend unsigned long long atomic_exchange_explicit( volatile atomic_ullong*,
1196 unsigned long long, memory_order );
1197 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ullong*,
1198 unsigned long long*, unsigned long long, memory_order, memory_order );
1199 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ullong*,
1200 unsigned long long*, unsigned long long, memory_order, memory_order );
1201 friend unsigned long long atomic_fetch_add_explicit( volatile atomic_ullong*,
1202 unsigned long long, memory_order );
1203 friend unsigned long long atomic_fetch_sub_explicit( volatile atomic_ullong*,
1204 unsigned long long, memory_order );
1205 friend unsigned long long atomic_fetch_and_explicit( volatile atomic_ullong*,
1206 unsigned long long, memory_order );
1207 friend unsigned long long atomic_fetch_or_explicit( volatile atomic_ullong*,
1208 unsigned long long, memory_order );
1209 friend unsigned long long atomic_fetch_xor_explicit( volatile atomic_ullong*,
1210 unsigned long long, memory_order );
1214 unsigned long long __f__;
1218 typedef atomic_schar atomic_int_least8_t;
1219 typedef atomic_uchar atomic_uint_least8_t;
1220 typedef atomic_short atomic_int_least16_t;
1221 typedef atomic_ushort atomic_uint_least16_t;
1222 typedef atomic_int atomic_int_least32_t;
1223 typedef atomic_uint atomic_uint_least32_t;
1224 typedef atomic_llong atomic_int_least64_t;
1225 typedef atomic_ullong atomic_uint_least64_t;
1227 typedef atomic_schar atomic_int_fast8_t;
1228 typedef atomic_uchar atomic_uint_fast8_t;
1229 typedef atomic_short atomic_int_fast16_t;
1230 typedef atomic_ushort atomic_uint_fast16_t;
1231 typedef atomic_int atomic_int_fast32_t;
1232 typedef atomic_uint atomic_uint_fast32_t;
1233 typedef atomic_llong atomic_int_fast64_t;
1234 typedef atomic_ullong atomic_uint_fast64_t;
1236 typedef atomic_long atomic_intptr_t;
1237 typedef atomic_ulong atomic_uintptr_t;
1239 typedef atomic_long atomic_ssize_t;
1240 typedef atomic_ulong atomic_size_t;
1242 typedef atomic_long atomic_ptrdiff_t;
1244 typedef atomic_llong atomic_intmax_t;
1245 typedef atomic_ullong atomic_uintmax_t;
1251 typedef struct atomic_wchar_t
1254 bool is_lock_free() const volatile;
1255 void store( wchar_t, memory_order = memory_order_seq_cst ) volatile;
1256 wchar_t load( memory_order = memory_order_seq_cst ) volatile;
1257 wchar_t exchange( wchar_t,
1258 memory_order = memory_order_seq_cst ) volatile;
1259 bool compare_exchange_weak( wchar_t&, wchar_t,
1260 memory_order, memory_order ) volatile;
1261 bool compare_exchange_strong( wchar_t&, wchar_t,
1262 memory_order, memory_order ) volatile;
1263 bool compare_exchange_weak( wchar_t&, wchar_t,
1264 memory_order = memory_order_seq_cst ) volatile;
1265 bool compare_exchange_strong( wchar_t&, wchar_t,
1266 memory_order = memory_order_seq_cst ) volatile;
1267 wchar_t fetch_add( wchar_t,
1268 memory_order = memory_order_seq_cst ) volatile;
1269 wchar_t fetch_sub( wchar_t,
1270 memory_order = memory_order_seq_cst ) volatile;
1271 wchar_t fetch_and( wchar_t,
1272 memory_order = memory_order_seq_cst ) volatile;
1273 wchar_t fetch_or( wchar_t,
1274 memory_order = memory_order_seq_cst ) volatile;
1275 wchar_t fetch_xor( wchar_t,
1276 memory_order = memory_order_seq_cst ) volatile;
1278 CPP0X( atomic_wchar_t() = default; )
1279 CPP0X( constexpr atomic_wchar_t( wchar_t __v__ ) : __f__( __v__) { } )
1280 CPP0X( atomic_wchar_t( const atomic_wchar_t& ) = delete; )
1281 atomic_wchar_t& operator =( const atomic_wchar_t& ) CPP0X(=delete);
1283 wchar_t operator =( wchar_t __v__ ) volatile
1284 { store( __v__ ); return __v__; }
1286 wchar_t operator ++( int ) volatile
1287 { return fetch_add( 1 ); }
1289 wchar_t operator --( int ) volatile
1290 { return fetch_sub( 1 ); }
1292 wchar_t operator ++() volatile
1293 { return fetch_add( 1 ) + 1; }
1295 wchar_t operator --() volatile
1296 { return fetch_sub( 1 ) - 1; }
1298 wchar_t operator +=( wchar_t __v__ ) volatile
1299 { return fetch_add( __v__ ) + __v__; }
1301 wchar_t operator -=( wchar_t __v__ ) volatile
1302 { return fetch_sub( __v__ ) - __v__; }
1304 wchar_t operator &=( wchar_t __v__ ) volatile
1305 { return fetch_and( __v__ ) & __v__; }
1307 wchar_t operator |=( wchar_t __v__ ) volatile
1308 { return fetch_or( __v__ ) | __v__; }
1310 wchar_t operator ^=( wchar_t __v__ ) volatile
1311 { return fetch_xor( __v__ ) ^ __v__; }
1313 friend void atomic_store_explicit( volatile atomic_wchar_t*, wchar_t,
1315 friend wchar_t atomic_load_explicit( volatile atomic_wchar_t*,
1317 friend wchar_t atomic_exchange_explicit( volatile atomic_wchar_t*,
1318 wchar_t, memory_order );
1319 friend bool atomic_compare_exchange_weak_explicit( volatile atomic_wchar_t*,
1320 wchar_t*, wchar_t, memory_order, memory_order );
1321 friend bool atomic_compare_exchange_strong_explicit( volatile atomic_wchar_t*,
1322 wchar_t*, wchar_t, memory_order, memory_order );
1323 friend wchar_t atomic_fetch_add_explicit( volatile atomic_wchar_t*,
1324 wchar_t, memory_order );
1325 friend wchar_t atomic_fetch_sub_explicit( volatile atomic_wchar_t*,
1326 wchar_t, memory_order );
1327 friend wchar_t atomic_fetch_and_explicit( volatile atomic_wchar_t*,
1328 wchar_t, memory_order );
1329 friend wchar_t atomic_fetch_or_explicit( volatile atomic_wchar_t*,
1330 wchar_t, memory_order );
1331 friend wchar_t atomic_fetch_xor_explicit( volatile atomic_wchar_t*,
1332 wchar_t, memory_order );
1342 typedef atomic_int_least16_t atomic_char16_t;
1343 typedef atomic_int_least32_t atomic_char32_t;
1344 typedef atomic_int_least32_t atomic_wchar_t;
1351 template< typename T >
1356 bool is_lock_free() const volatile;
1357 void store( T, memory_order = memory_order_seq_cst ) volatile;
1358 T load( memory_order = memory_order_seq_cst ) volatile;
1359 T exchange( T __v__, memory_order = memory_order_seq_cst ) volatile;
1360 bool compare_exchange_weak( T&, T, memory_order, memory_order ) volatile;
1361 bool compare_exchange_strong( T&, T, memory_order, memory_order ) volatile;
1362 bool compare_exchange_weak( T&, T, memory_order = memory_order_seq_cst ) volatile;
1363 bool compare_exchange_strong( T&, T, memory_order = memory_order_seq_cst ) volatile;
1365 CPP0X( atomic() = default; )
1366 CPP0X( constexpr explicit atomic( T __v__ ) : __f__( __v__ ) { } )
1367 CPP0X( atomic( const atomic& ) = delete; )
1368 atomic& operator =( const atomic& ) CPP0X(=delete);
1370 T operator =( T __v__ ) volatile
1371 { store( __v__ ); return __v__; }
1382 template<typename T> struct atomic< T* > : atomic_address
1384 T* load( memory_order = memory_order_seq_cst ) volatile;
1385 T* exchange( T*, memory_order = memory_order_seq_cst ) volatile;
1386 bool compare_exchange_weak( T*&, T*, memory_order, memory_order ) volatile;
1387 bool compare_exchange_strong( T*&, T*, memory_order, memory_order ) volatile;
1388 bool compare_exchange_weak( T*&, T*,
1389 memory_order = memory_order_seq_cst ) volatile;
1390 bool compare_exchange_strong( T*&, T*,
1391 memory_order = memory_order_seq_cst ) volatile;
1392 T* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
1393 T* fetch_sub( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
1395 CPP0X( atomic() = default; )
1396 CPP0X( constexpr explicit atomic( T __v__ ) : atomic_address( __v__ ) { } )
1397 CPP0X( atomic( const atomic& ) = delete; )
1398 atomic& operator =( const atomic& ) CPP0X(=delete);
1400 T* operator =( T* __v__ ) volatile
1401 { store( __v__ ); return __v__; }
1403 T* operator ++( int ) volatile
1404 { return fetch_add( 1 ); }
1406 T* operator --( int ) volatile
1407 { return fetch_sub( 1 ); }
1409 T* operator ++() volatile
1410 { return fetch_add( 1 ) + 1; }
1412 T* operator --() volatile
1413 { return fetch_sub( 1 ) - 1; }
1415 T* operator +=( T* __v__ ) volatile
1416 { return fetch_add( __v__ ) + __v__; }
1418 T* operator -=( T* __v__ ) volatile
1419 { return fetch_sub( __v__ ) - __v__; }
1427 template<> struct atomic< bool > : atomic_bool
1429 CPP0X( atomic() = default; )
1430 CPP0X( constexpr explicit atomic( bool __v__ )
1431 : atomic_bool( __v__ ) { } )
1432 CPP0X( atomic( const atomic& ) = delete; )
1433 atomic& operator =( const atomic& ) CPP0X(=delete);
1435 bool operator =( bool __v__ ) volatile
1436 { store( __v__ ); return __v__; }
1440 template<> struct atomic< void* > : atomic_address
1442 CPP0X( atomic() = default; )
1443 CPP0X( constexpr explicit atomic( void* __v__ )
1444 : atomic_address( __v__ ) { } )
1445 CPP0X( atomic( const atomic& ) = delete; )
1446 atomic& operator =( const atomic& ) CPP0X(=delete);
1448 void* operator =( void* __v__ ) volatile
1449 { store( __v__ ); return __v__; }
1453 template<> struct atomic< char > : atomic_char
1455 CPP0X( atomic() = default; )
1456 CPP0X( constexpr explicit atomic( char __v__ )
1457 : atomic_char( __v__ ) { } )
1458 CPP0X( atomic( const atomic& ) = delete; )
1459 atomic& operator =( const atomic& ) CPP0X(=delete);
1461 char operator =( char __v__ ) volatile
1462 { store( __v__ ); return __v__; }
1466 template<> struct atomic< signed char > : atomic_schar
1468 CPP0X( atomic() = default; )
1469 CPP0X( constexpr explicit atomic( signed char __v__ )
1470 : atomic_schar( __v__ ) { } )
1471 CPP0X( atomic( const atomic& ) = delete; )
1472 atomic& operator =( const atomic& ) CPP0X(=delete);
1474 signed char operator =( signed char __v__ ) volatile
1475 { store( __v__ ); return __v__; }
1479 template<> struct atomic< unsigned char > : atomic_uchar
1481 CPP0X( atomic() = default; )
1482 CPP0X( constexpr explicit atomic( unsigned char __v__ )
1483 : atomic_uchar( __v__ ) { } )
1484 CPP0X( atomic( const atomic& ) = delete; )
1485 atomic& operator =( const atomic& ) CPP0X(=delete);
1487 unsigned char operator =( unsigned char __v__ ) volatile
1488 { store( __v__ ); return __v__; }
1492 template<> struct atomic< short > : atomic_short
1494 CPP0X( atomic() = default; )
1495 CPP0X( constexpr explicit atomic( short __v__ )
1496 : atomic_short( __v__ ) { } )
1497 CPP0X( atomic( const atomic& ) = delete; )
1498 atomic& operator =( const atomic& ) CPP0X(=delete);
1500 short operator =( short __v__ ) volatile
1501 { store( __v__ ); return __v__; }
1505 template<> struct atomic< unsigned short > : atomic_ushort
1507 CPP0X( atomic() = default; )
1508 CPP0X( constexpr explicit atomic( unsigned short __v__ )
1509 : atomic_ushort( __v__ ) { } )
1510 CPP0X( atomic( const atomic& ) = delete; )
1511 atomic& operator =( const atomic& ) CPP0X(=delete);
1513 unsigned short operator =( unsigned short __v__ ) volatile
1514 { store( __v__ ); return __v__; }
1518 template<> struct atomic< int > : atomic_int
1520 CPP0X( atomic() = default; )
1521 CPP0X( constexpr explicit atomic( int __v__ )
1522 : atomic_int( __v__ ) { } )
1523 CPP0X( atomic( const atomic& ) = delete; )
1524 atomic& operator =( const atomic& ) CPP0X(=delete);
1526 int operator =( int __v__ ) volatile
1527 { store( __v__ ); return __v__; }
1531 template<> struct atomic< unsigned int > : atomic_uint
1533 CPP0X( atomic() = default; )
1534 CPP0X( constexpr explicit atomic( unsigned int __v__ )
1535 : atomic_uint( __v__ ) { } )
1536 CPP0X( atomic( const atomic& ) = delete; )
1537 atomic& operator =( const atomic& ) CPP0X(=delete);
1539 unsigned int operator =( unsigned int __v__ ) volatile
1540 { store( __v__ ); return __v__; }
1544 template<> struct atomic< long > : atomic_long
1546 CPP0X( atomic() = default; )
1547 CPP0X( constexpr explicit atomic( long __v__ )
1548 : atomic_long( __v__ ) { } )
1549 CPP0X( atomic( const atomic& ) = delete; )
1550 atomic& operator =( const atomic& ) CPP0X(=delete);
1552 long operator =( long __v__ ) volatile
1553 { store( __v__ ); return __v__; }
1557 template<> struct atomic< unsigned long > : atomic_ulong
1559 CPP0X( atomic() = default; )
1560 CPP0X( constexpr explicit atomic( unsigned long __v__ )
1561 : atomic_ulong( __v__ ) { } )
1562 CPP0X( atomic( const atomic& ) = delete; )
1563 atomic& operator =( const atomic& ) CPP0X(=delete);
1565 unsigned long operator =( unsigned long __v__ ) volatile
1566 { store( __v__ ); return __v__; }
1570 template<> struct atomic< long long > : atomic_llong
1572 CPP0X( atomic() = default; )
1573 CPP0X( constexpr explicit atomic( long long __v__ )
1574 : atomic_llong( __v__ ) { } )
1575 CPP0X( atomic( const atomic& ) = delete; )
1576 atomic& operator =( const atomic& ) CPP0X(=delete);
1578 long long operator =( long long __v__ ) volatile
1579 { store( __v__ ); return __v__; }
1583 template<> struct atomic< unsigned long long > : atomic_ullong
1585 CPP0X( atomic() = default; )
1586 CPP0X( constexpr explicit atomic( unsigned long long __v__ )
1587 : atomic_ullong( __v__ ) { } )
1588 CPP0X( atomic( const atomic& ) = delete; )
1589 atomic& operator =( const atomic& ) CPP0X(=delete);
1591 unsigned long long operator =( unsigned long long __v__ ) volatile
1592 { store( __v__ ); return __v__; }
1596 template<> struct atomic< wchar_t > : atomic_wchar_t
1598 CPP0X( atomic() = default; )
1599 CPP0X( constexpr explicit atomic( wchar_t __v__ )
1600 : atomic_wchar_t( __v__ ) { } )
1601 CPP0X( atomic( const atomic& ) = delete; )
1602 atomic& operator =( const atomic& ) CPP0X(=delete);
1604 wchar_t operator =( wchar_t __v__ ) volatile
1605 { store( __v__ ); return __v__; }
1615 inline bool atomic_is_lock_free
1616 ( const volatile atomic_bool* __a__ )
1619 inline bool atomic_load_explicit
1620 ( volatile atomic_bool* __a__, memory_order __x__ )
1621 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1623 inline bool atomic_load
1624 ( volatile atomic_bool* __a__ ) { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1626 inline void atomic_init
1627 ( volatile atomic_bool* __a__, bool __m__ )
1628 { _ATOMIC_INIT_( __a__, __m__ ); }
1630 inline void atomic_store_explicit
1631 ( volatile atomic_bool* __a__, bool __m__, memory_order __x__ )
1632 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1634 inline void atomic_store
1635 ( volatile atomic_bool* __a__, bool __m__ )
1636 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1638 inline bool atomic_exchange_explicit
1639 ( volatile atomic_bool* __a__, bool __m__, memory_order __x__ )
1640 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1642 inline bool atomic_exchange
1643 ( volatile atomic_bool* __a__, bool __m__ )
1644 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1646 inline bool atomic_compare_exchange_weak_explicit
1647 ( volatile atomic_bool* __a__, bool* __e__, bool __m__,
1648 memory_order __x__, memory_order __y__ )
1649 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1651 inline bool atomic_compare_exchange_strong_explicit
1652 ( volatile atomic_bool* __a__, bool* __e__, bool __m__,
1653 memory_order __x__, memory_order __y__ )
1654 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1656 inline bool atomic_compare_exchange_weak
1657 ( volatile atomic_bool* __a__, bool* __e__, bool __m__ )
1658 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1659 memory_order_seq_cst, memory_order_seq_cst ); }
1661 inline bool atomic_compare_exchange_strong
1662 ( volatile atomic_bool* __a__, bool* __e__, bool __m__ )
1663 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1664 memory_order_seq_cst, memory_order_seq_cst ); }
1667 inline bool atomic_is_lock_free( const volatile atomic_address* __a__ )
1670 inline void* atomic_load_explicit
1671 ( volatile atomic_address* __a__, memory_order __x__ )
1672 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1674 inline void* atomic_load( volatile atomic_address* __a__ )
1675 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1677 inline void atomic_init
1678 ( volatile atomic_address* __a__, void* __m__ )
1679 { _ATOMIC_INIT_( __a__, __m__ ); }
1681 inline void atomic_store_explicit
1682 ( volatile atomic_address* __a__, void* __m__, memory_order __x__ )
1683 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1685 inline void atomic_store
1686 ( volatile atomic_address* __a__, void* __m__ )
1687 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1689 inline void* atomic_exchange_explicit
1690 ( volatile atomic_address* __a__, void* __m__, memory_order __x__ )
1691 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1693 inline void* atomic_exchange
1694 ( volatile atomic_address* __a__, void* __m__ )
1695 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1697 inline bool atomic_compare_exchange_weak_explicit
1698 ( volatile atomic_address* __a__, void** __e__, void* __m__,
1699 memory_order __x__, memory_order __y__ )
1700 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1702 inline bool atomic_compare_exchange_strong_explicit
1703 ( volatile atomic_address* __a__, void** __e__, void* __m__,
1704 memory_order __x__, memory_order __y__ )
1705 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1707 inline bool atomic_compare_exchange_weak
1708 ( volatile atomic_address* __a__, void** __e__, void* __m__ )
1709 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1710 memory_order_seq_cst, memory_order_seq_cst ); }
1712 inline bool atomic_compare_exchange_strong
1713 ( volatile atomic_address* __a__, void** __e__, void* __m__ )
1714 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1715 memory_order_seq_cst, memory_order_seq_cst ); }
1718 inline bool atomic_is_lock_free( const volatile atomic_char* __a__ )
1721 inline char atomic_load_explicit
1722 ( volatile atomic_char* __a__, memory_order __x__ )
1723 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1725 inline char atomic_load( volatile atomic_char* __a__ )
1726 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1728 inline void atomic_init
1729 ( volatile atomic_char* __a__, char __m__ )
1730 { _ATOMIC_INIT_( __a__, __m__ ); }
1732 inline void atomic_store_explicit
1733 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
1734 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1736 inline void atomic_store
1737 ( volatile atomic_char* __a__, char __m__ )
1738 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1740 inline char atomic_exchange_explicit
1741 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
1742 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1744 inline char atomic_exchange
1745 ( volatile atomic_char* __a__, char __m__ )
1746 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1748 inline bool atomic_compare_exchange_weak_explicit
1749 ( volatile atomic_char* __a__, char* __e__, char __m__,
1750 memory_order __x__, memory_order __y__ )
1751 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1753 inline bool atomic_compare_exchange_strong_explicit
1754 ( volatile atomic_char* __a__, char* __e__, char __m__,
1755 memory_order __x__, memory_order __y__ )
1756 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1758 inline bool atomic_compare_exchange_weak
1759 ( volatile atomic_char* __a__, char* __e__, char __m__ )
1760 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1761 memory_order_seq_cst, memory_order_seq_cst ); }
1763 inline bool atomic_compare_exchange_strong
1764 ( volatile atomic_char* __a__, char* __e__, char __m__ )
1765 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1766 memory_order_seq_cst, memory_order_seq_cst ); }
1769 inline bool atomic_is_lock_free( const volatile atomic_schar* __a__ )
1772 inline signed char atomic_load_explicit
1773 ( volatile atomic_schar* __a__, memory_order __x__ )
1774 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1776 inline signed char atomic_load( volatile atomic_schar* __a__ )
1777 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1779 inline void atomic_init
1780 ( volatile atomic_schar* __a__, signed char __m__ )
1781 { _ATOMIC_INIT_( __a__, __m__ ); }
1783 inline void atomic_store_explicit
1784 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
1785 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1787 inline void atomic_store
1788 ( volatile atomic_schar* __a__, signed char __m__ )
1789 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1791 inline signed char atomic_exchange_explicit
1792 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
1793 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1795 inline signed char atomic_exchange
1796 ( volatile atomic_schar* __a__, signed char __m__ )
1797 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1799 inline bool atomic_compare_exchange_weak_explicit
1800 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__,
1801 memory_order __x__, memory_order __y__ )
1802 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1804 inline bool atomic_compare_exchange_strong_explicit
1805 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__,
1806 memory_order __x__, memory_order __y__ )
1807 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1809 inline bool atomic_compare_exchange_weak
1810 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__ )
1811 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1812 memory_order_seq_cst, memory_order_seq_cst ); }
1814 inline bool atomic_compare_exchange_strong
1815 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__ )
1816 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1817 memory_order_seq_cst, memory_order_seq_cst ); }
1820 inline bool atomic_is_lock_free( const volatile atomic_uchar* __a__ )
1823 inline unsigned char atomic_load_explicit
1824 ( volatile atomic_uchar* __a__, memory_order __x__ )
1825 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1827 inline unsigned char atomic_load( volatile atomic_uchar* __a__ )
1828 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1830 inline void atomic_init
1831 ( volatile atomic_uchar* __a__, unsigned char __m__ )
1832 { _ATOMIC_INIT_( __a__, __m__ ); }
1834 inline void atomic_store_explicit
1835 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
1836 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1838 inline void atomic_store
1839 ( volatile atomic_uchar* __a__, unsigned char __m__ )
1840 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1842 inline unsigned char atomic_exchange_explicit
1843 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
1844 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1846 inline unsigned char atomic_exchange
1847 ( volatile atomic_uchar* __a__, unsigned char __m__ )
1848 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1850 inline bool atomic_compare_exchange_weak_explicit
1851 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__,
1852 memory_order __x__, memory_order __y__ )
1853 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1855 inline bool atomic_compare_exchange_strong_explicit
1856 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__,
1857 memory_order __x__, memory_order __y__ )
1858 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1860 inline bool atomic_compare_exchange_weak
1861 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__ )
1862 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1863 memory_order_seq_cst, memory_order_seq_cst ); }
1865 inline bool atomic_compare_exchange_strong
1866 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__ )
1867 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1868 memory_order_seq_cst, memory_order_seq_cst ); }
1871 inline bool atomic_is_lock_free( const volatile atomic_short* __a__ )
1874 inline short atomic_load_explicit
1875 ( volatile atomic_short* __a__, memory_order __x__ )
1876 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1878 inline short atomic_load( volatile atomic_short* __a__ )
1879 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1881 inline void atomic_init
1882 ( volatile atomic_short* __a__, short __m__ )
1883 { _ATOMIC_INIT_( __a__, __m__ ); }
1885 inline void atomic_store_explicit
1886 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
1887 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1889 inline void atomic_store
1890 ( volatile atomic_short* __a__, short __m__ )
1891 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1893 inline short atomic_exchange_explicit
1894 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
1895 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1897 inline short atomic_exchange
1898 ( volatile atomic_short* __a__, short __m__ )
1899 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1901 inline bool atomic_compare_exchange_weak_explicit
1902 ( volatile atomic_short* __a__, short* __e__, short __m__,
1903 memory_order __x__, memory_order __y__ )
1904 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1906 inline bool atomic_compare_exchange_strong_explicit
1907 ( volatile atomic_short* __a__, short* __e__, short __m__,
1908 memory_order __x__, memory_order __y__ )
1909 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1911 inline bool atomic_compare_exchange_weak
1912 ( volatile atomic_short* __a__, short* __e__, short __m__ )
1913 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1914 memory_order_seq_cst, memory_order_seq_cst ); }
1916 inline bool atomic_compare_exchange_strong
1917 ( volatile atomic_short* __a__, short* __e__, short __m__ )
1918 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1919 memory_order_seq_cst, memory_order_seq_cst ); }
1922 inline bool atomic_is_lock_free( const volatile atomic_ushort* __a__ )
1925 inline unsigned short atomic_load_explicit
1926 ( volatile atomic_ushort* __a__, memory_order __x__ )
1927 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1929 inline unsigned short atomic_load( volatile atomic_ushort* __a__ )
1930 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1932 inline void atomic_init
1933 ( volatile atomic_ushort* __a__, unsigned short __m__ )
1934 { _ATOMIC_INIT_( __a__, __m__ ); }
1936 inline void atomic_store_explicit
1937 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
1938 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1940 inline void atomic_store
1941 ( volatile atomic_ushort* __a__, unsigned short __m__ )
1942 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1944 inline unsigned short atomic_exchange_explicit
1945 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
1946 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1948 inline unsigned short atomic_exchange
1949 ( volatile atomic_ushort* __a__, unsigned short __m__ )
1950 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
1952 inline bool atomic_compare_exchange_weak_explicit
1953 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__,
1954 memory_order __x__, memory_order __y__ )
1955 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
1957 inline bool atomic_compare_exchange_strong_explicit
1958 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__,
1959 memory_order __x__, memory_order __y__ )
1960 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
1962 inline bool atomic_compare_exchange_weak
1963 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__ )
1964 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
1965 memory_order_seq_cst, memory_order_seq_cst ); }
1967 inline bool atomic_compare_exchange_strong
1968 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__ )
1969 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
1970 memory_order_seq_cst, memory_order_seq_cst ); }
1973 inline bool atomic_is_lock_free( const volatile atomic_int* __a__ )
1976 inline int atomic_load_explicit
1977 ( volatile atomic_int* __a__, memory_order __x__ )
1978 { return _ATOMIC_LOAD_( __a__, __x__ ); }
1980 inline int atomic_load( volatile atomic_int* __a__ )
1981 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
1983 inline void atomic_init
1984 ( volatile atomic_int* __a__, int __m__ )
1985 { _ATOMIC_INIT_( __a__, __m__ ); }
1987 inline void atomic_store_explicit
1988 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
1989 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
1991 inline void atomic_store
1992 ( volatile atomic_int* __a__, int __m__ )
1993 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
1995 inline int atomic_exchange_explicit
1996 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
1997 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
1999 inline int atomic_exchange
2000 ( volatile atomic_int* __a__, int __m__ )
2001 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2003 inline bool atomic_compare_exchange_weak_explicit
2004 ( volatile atomic_int* __a__, int* __e__, int __m__,
2005 memory_order __x__, memory_order __y__ )
2006 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2008 inline bool atomic_compare_exchange_strong_explicit
2009 ( volatile atomic_int* __a__, int* __e__, int __m__,
2010 memory_order __x__, memory_order __y__ )
2011 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2013 inline bool atomic_compare_exchange_weak
2014 ( volatile atomic_int* __a__, int* __e__, int __m__ )
2015 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2016 memory_order_seq_cst, memory_order_seq_cst ); }
2018 inline bool atomic_compare_exchange_strong
2019 ( volatile atomic_int* __a__, int* __e__, int __m__ )
2020 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2021 memory_order_seq_cst, memory_order_seq_cst ); }
2024 inline bool atomic_is_lock_free( const volatile atomic_uint* __a__ )
2027 inline unsigned int atomic_load_explicit
2028 ( volatile atomic_uint* __a__, memory_order __x__ )
2029 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2031 inline unsigned int atomic_load( volatile atomic_uint* __a__ )
2032 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2034 inline void atomic_init
2035 ( volatile atomic_uint* __a__, unsigned int __m__ )
2036 { _ATOMIC_INIT_( __a__, __m__ ); }
2038 inline void atomic_store_explicit
2039 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2040 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2042 inline void atomic_store
2043 ( volatile atomic_uint* __a__, unsigned int __m__ )
2044 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2046 inline unsigned int atomic_exchange_explicit
2047 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2048 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2050 inline unsigned int atomic_exchange
2051 ( volatile atomic_uint* __a__, unsigned int __m__ )
2052 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2054 inline bool atomic_compare_exchange_weak_explicit
2055 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__,
2056 memory_order __x__, memory_order __y__ )
2057 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2059 inline bool atomic_compare_exchange_strong_explicit
2060 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__,
2061 memory_order __x__, memory_order __y__ )
2062 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2064 inline bool atomic_compare_exchange_weak
2065 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__ )
2066 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2067 memory_order_seq_cst, memory_order_seq_cst ); }
2069 inline bool atomic_compare_exchange_strong
2070 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__ )
2071 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2072 memory_order_seq_cst, memory_order_seq_cst ); }
2075 inline bool atomic_is_lock_free( const volatile atomic_long* __a__ )
2078 inline long atomic_load_explicit
2079 ( volatile atomic_long* __a__, memory_order __x__ )
2080 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2082 inline long atomic_load( volatile atomic_long* __a__ )
2083 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2085 inline void atomic_init
2086 ( volatile atomic_long* __a__, long __m__ )
2087 { _ATOMIC_INIT_( __a__, __m__ ); }
2089 inline void atomic_store_explicit
2090 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2091 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2093 inline void atomic_store
2094 ( volatile atomic_long* __a__, long __m__ )
2095 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2097 inline long atomic_exchange_explicit
2098 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2099 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2101 inline long atomic_exchange
2102 ( volatile atomic_long* __a__, long __m__ )
2103 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2105 inline bool atomic_compare_exchange_weak_explicit
2106 ( volatile atomic_long* __a__, long* __e__, long __m__,
2107 memory_order __x__, memory_order __y__ )
2108 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2110 inline bool atomic_compare_exchange_strong_explicit
2111 ( volatile atomic_long* __a__, long* __e__, long __m__,
2112 memory_order __x__, memory_order __y__ )
2113 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2115 inline bool atomic_compare_exchange_weak
2116 ( volatile atomic_long* __a__, long* __e__, long __m__ )
2117 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2118 memory_order_seq_cst, memory_order_seq_cst ); }
2120 inline bool atomic_compare_exchange_strong
2121 ( volatile atomic_long* __a__, long* __e__, long __m__ )
2122 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2123 memory_order_seq_cst, memory_order_seq_cst ); }
2126 inline bool atomic_is_lock_free( const volatile atomic_ulong* __a__ )
2129 inline unsigned long atomic_load_explicit
2130 ( volatile atomic_ulong* __a__, memory_order __x__ )
2131 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2133 inline unsigned long atomic_load( volatile atomic_ulong* __a__ )
2134 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2136 inline void atomic_init
2137 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2138 { _ATOMIC_INIT_( __a__, __m__ ); }
2140 inline void atomic_store_explicit
2141 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2142 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2144 inline void atomic_store
2145 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2146 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2148 inline unsigned long atomic_exchange_explicit
2149 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2150 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2152 inline unsigned long atomic_exchange
2153 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2154 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2156 inline bool atomic_compare_exchange_weak_explicit
2157 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__,
2158 memory_order __x__, memory_order __y__ )
2159 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2161 inline bool atomic_compare_exchange_strong_explicit
2162 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__,
2163 memory_order __x__, memory_order __y__ )
2164 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2166 inline bool atomic_compare_exchange_weak
2167 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__ )
2168 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2169 memory_order_seq_cst, memory_order_seq_cst ); }
2171 inline bool atomic_compare_exchange_strong
2172 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__ )
2173 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2174 memory_order_seq_cst, memory_order_seq_cst ); }
2177 inline bool atomic_is_lock_free( const volatile atomic_llong* __a__ )
2180 inline long long atomic_load_explicit
2181 ( volatile atomic_llong* __a__, memory_order __x__ )
2182 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2184 inline long long atomic_load( volatile atomic_llong* __a__ )
2185 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2187 inline void atomic_init
2188 ( volatile atomic_llong* __a__, long long __m__ )
2189 { _ATOMIC_INIT_( __a__, __m__ ); }
2191 inline void atomic_store_explicit
2192 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2193 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2195 inline void atomic_store
2196 ( volatile atomic_llong* __a__, long long __m__ )
2197 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2199 inline long long atomic_exchange_explicit
2200 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2201 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2203 inline long long atomic_exchange
2204 ( volatile atomic_llong* __a__, long long __m__ )
2205 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2207 inline bool atomic_compare_exchange_weak_explicit
2208 ( volatile atomic_llong* __a__, long long* __e__, long long __m__,
2209 memory_order __x__, memory_order __y__ )
2210 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2212 inline bool atomic_compare_exchange_strong_explicit
2213 ( volatile atomic_llong* __a__, long long* __e__, long long __m__,
2214 memory_order __x__, memory_order __y__ )
2215 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2217 inline bool atomic_compare_exchange_weak
2218 ( volatile atomic_llong* __a__, long long* __e__, long long __m__ )
2219 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2220 memory_order_seq_cst, memory_order_seq_cst ); }
2222 inline bool atomic_compare_exchange_strong
2223 ( volatile atomic_llong* __a__, long long* __e__, long long __m__ )
2224 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2225 memory_order_seq_cst, memory_order_seq_cst ); }
2228 inline bool atomic_is_lock_free( const volatile atomic_ullong* __a__ )
2231 inline unsigned long long atomic_load_explicit
2232 ( volatile atomic_ullong* __a__, memory_order __x__ )
2233 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2235 inline unsigned long long atomic_load( volatile atomic_ullong* __a__ )
2236 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2238 inline void atomic_init
2239 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2240 { _ATOMIC_INIT_( __a__, __m__ ); }
2242 inline void atomic_store_explicit
2243 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2244 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2246 inline void atomic_store
2247 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2248 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2250 inline unsigned long long atomic_exchange_explicit
2251 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2252 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2254 inline unsigned long long atomic_exchange
2255 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2256 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2258 inline bool atomic_compare_exchange_weak_explicit
2259 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__,
2260 memory_order __x__, memory_order __y__ )
2261 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2263 inline bool atomic_compare_exchange_strong_explicit
2264 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__,
2265 memory_order __x__, memory_order __y__ )
2266 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2268 inline bool atomic_compare_exchange_weak
2269 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__ )
2270 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2271 memory_order_seq_cst, memory_order_seq_cst ); }
2273 inline bool atomic_compare_exchange_strong
2274 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__ )
2275 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2276 memory_order_seq_cst, memory_order_seq_cst ); }
2279 inline bool atomic_is_lock_free( const volatile atomic_wchar_t* __a__ )
2282 inline wchar_t atomic_load_explicit
2283 ( volatile atomic_wchar_t* __a__, memory_order __x__ )
2284 { return _ATOMIC_LOAD_( __a__, __x__ ); }
2286 inline wchar_t atomic_load( volatile atomic_wchar_t* __a__ )
2287 { return atomic_load_explicit( __a__, memory_order_seq_cst ); }
2289 inline void atomic_init
2290 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2291 { _ATOMIC_INIT_( __a__, __m__ ); }
2293 inline void atomic_store_explicit
2294 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2295 { _ATOMIC_STORE_( __a__, __m__, __x__ ); }
2297 inline void atomic_store
2298 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2299 { atomic_store_explicit( __a__, __m__, memory_order_seq_cst ); }
2301 inline wchar_t atomic_exchange_explicit
2302 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2303 { return _ATOMIC_MODIFY_( __a__, =, __m__, __x__ ); }
2305 inline wchar_t atomic_exchange
2306 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2307 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
2309 inline bool atomic_compare_exchange_weak_explicit
2310 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__,
2311 memory_order __x__, memory_order __y__ )
2312 { return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
2314 inline bool atomic_compare_exchange_strong_explicit
2315 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__,
2316 memory_order __x__, memory_order __y__ )
2317 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
2319 inline bool atomic_compare_exchange_weak
2320 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__ )
2321 { return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
2322 memory_order_seq_cst, memory_order_seq_cst ); }
2324 inline bool atomic_compare_exchange_strong
2325 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__ )
2326 { return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
2327 memory_order_seq_cst, memory_order_seq_cst ); }
2330 inline void* atomic_fetch_add_explicit
2331 ( volatile atomic_address* __a__, ptrdiff_t __m__, memory_order __x__ )
2333 void* volatile* __p__ = &((__a__)->__f__);
2334 void* __r__ = (void *) model_rmwr_action((void *)__p__, __x__);
2335 model_rmw_action((void *)__p__, __x__, (uint64_t) ((char*)(*__p__) + __m__));
2338 inline void* atomic_fetch_add
2339 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
2340 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2343 inline void* atomic_fetch_sub_explicit
2344 ( volatile atomic_address* __a__, ptrdiff_t __m__, memory_order __x__ )
2346 void* volatile* __p__ = &((__a__)->__f__);
2347 void* __r__ = (void *) model_rmwr_action((void *)__p__, __x__);
2348 model_rmw_action((void *)__p__, __x__, (uint64_t)((char*)(*__p__) - __m__));
2351 inline void* atomic_fetch_sub
2352 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
2353 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2355 inline char atomic_fetch_add_explicit
2356 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2357 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2359 inline char atomic_fetch_add
2360 ( volatile atomic_char* __a__, char __m__ )
2361 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2364 inline char atomic_fetch_sub_explicit
2365 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2366 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2368 inline char atomic_fetch_sub
2369 ( volatile atomic_char* __a__, char __m__ )
2370 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2373 inline char atomic_fetch_and_explicit
2374 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2375 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2377 inline char atomic_fetch_and
2378 ( volatile atomic_char* __a__, char __m__ )
2379 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2382 inline char atomic_fetch_or_explicit
2383 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2384 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2386 inline char atomic_fetch_or
2387 ( volatile atomic_char* __a__, char __m__ )
2388 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2391 inline char atomic_fetch_xor_explicit
2392 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2393 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2395 inline char atomic_fetch_xor
2396 ( volatile atomic_char* __a__, char __m__ )
2397 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2400 inline signed char atomic_fetch_add_explicit
2401 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2402 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2404 inline signed char atomic_fetch_add
2405 ( volatile atomic_schar* __a__, signed char __m__ )
2406 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2409 inline signed char atomic_fetch_sub_explicit
2410 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2411 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2413 inline signed char atomic_fetch_sub
2414 ( volatile atomic_schar* __a__, signed char __m__ )
2415 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2418 inline signed char atomic_fetch_and_explicit
2419 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2420 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2422 inline signed char atomic_fetch_and
2423 ( volatile atomic_schar* __a__, signed char __m__ )
2424 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2427 inline signed char atomic_fetch_or_explicit
2428 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2429 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2431 inline signed char atomic_fetch_or
2432 ( volatile atomic_schar* __a__, signed char __m__ )
2433 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2436 inline signed char atomic_fetch_xor_explicit
2437 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2438 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2440 inline signed char atomic_fetch_xor
2441 ( volatile atomic_schar* __a__, signed char __m__ )
2442 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2445 inline unsigned char atomic_fetch_add_explicit
2446 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2447 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2449 inline unsigned char atomic_fetch_add
2450 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2451 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2454 inline unsigned char atomic_fetch_sub_explicit
2455 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2456 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2458 inline unsigned char atomic_fetch_sub
2459 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2460 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2463 inline unsigned char atomic_fetch_and_explicit
2464 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2465 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2467 inline unsigned char atomic_fetch_and
2468 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2469 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2472 inline unsigned char atomic_fetch_or_explicit
2473 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2474 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2476 inline unsigned char atomic_fetch_or
2477 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2478 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2481 inline unsigned char atomic_fetch_xor_explicit
2482 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2483 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2485 inline unsigned char atomic_fetch_xor
2486 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2487 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2490 inline short atomic_fetch_add_explicit
2491 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2492 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2494 inline short atomic_fetch_add
2495 ( volatile atomic_short* __a__, short __m__ )
2496 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2499 inline short atomic_fetch_sub_explicit
2500 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2501 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2503 inline short atomic_fetch_sub
2504 ( volatile atomic_short* __a__, short __m__ )
2505 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2508 inline short atomic_fetch_and_explicit
2509 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2510 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2512 inline short atomic_fetch_and
2513 ( volatile atomic_short* __a__, short __m__ )
2514 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2517 inline short atomic_fetch_or_explicit
2518 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2519 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2521 inline short atomic_fetch_or
2522 ( volatile atomic_short* __a__, short __m__ )
2523 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2526 inline short atomic_fetch_xor_explicit
2527 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2528 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2530 inline short atomic_fetch_xor
2531 ( volatile atomic_short* __a__, short __m__ )
2532 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2535 inline unsigned short atomic_fetch_add_explicit
2536 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2537 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2539 inline unsigned short atomic_fetch_add
2540 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2541 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2544 inline unsigned short atomic_fetch_sub_explicit
2545 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2546 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2548 inline unsigned short atomic_fetch_sub
2549 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2550 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2553 inline unsigned short atomic_fetch_and_explicit
2554 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2555 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2557 inline unsigned short atomic_fetch_and
2558 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2559 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2562 inline unsigned short atomic_fetch_or_explicit
2563 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2564 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2566 inline unsigned short atomic_fetch_or
2567 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2568 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2571 inline unsigned short atomic_fetch_xor_explicit
2572 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2573 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2575 inline unsigned short atomic_fetch_xor
2576 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2577 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2580 inline int atomic_fetch_add_explicit
2581 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2582 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2584 inline int atomic_fetch_add
2585 ( volatile atomic_int* __a__, int __m__ )
2586 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2589 inline int atomic_fetch_sub_explicit
2590 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2591 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2593 inline int atomic_fetch_sub
2594 ( volatile atomic_int* __a__, int __m__ )
2595 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2598 inline int atomic_fetch_and_explicit
2599 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2600 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2602 inline int atomic_fetch_and
2603 ( volatile atomic_int* __a__, int __m__ )
2604 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2607 inline int atomic_fetch_or_explicit
2608 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2609 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2611 inline int atomic_fetch_or
2612 ( volatile atomic_int* __a__, int __m__ )
2613 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2616 inline int atomic_fetch_xor_explicit
2617 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2618 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2620 inline int atomic_fetch_xor
2621 ( volatile atomic_int* __a__, int __m__ )
2622 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2625 inline unsigned int atomic_fetch_add_explicit
2626 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2627 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2629 inline unsigned int atomic_fetch_add
2630 ( volatile atomic_uint* __a__, unsigned int __m__ )
2631 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2634 inline unsigned int atomic_fetch_sub_explicit
2635 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2636 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2638 inline unsigned int atomic_fetch_sub
2639 ( volatile atomic_uint* __a__, unsigned int __m__ )
2640 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2643 inline unsigned int atomic_fetch_and_explicit
2644 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2645 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2647 inline unsigned int atomic_fetch_and
2648 ( volatile atomic_uint* __a__, unsigned int __m__ )
2649 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2652 inline unsigned int atomic_fetch_or_explicit
2653 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2654 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2656 inline unsigned int atomic_fetch_or
2657 ( volatile atomic_uint* __a__, unsigned int __m__ )
2658 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2661 inline unsigned int atomic_fetch_xor_explicit
2662 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2663 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2665 inline unsigned int atomic_fetch_xor
2666 ( volatile atomic_uint* __a__, unsigned int __m__ )
2667 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2670 inline long atomic_fetch_add_explicit
2671 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2672 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2674 inline long atomic_fetch_add
2675 ( volatile atomic_long* __a__, long __m__ )
2676 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2679 inline long atomic_fetch_sub_explicit
2680 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2681 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2683 inline long atomic_fetch_sub
2684 ( volatile atomic_long* __a__, long __m__ )
2685 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2688 inline long atomic_fetch_and_explicit
2689 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2690 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2692 inline long atomic_fetch_and
2693 ( volatile atomic_long* __a__, long __m__ )
2694 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2697 inline long atomic_fetch_or_explicit
2698 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2699 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2701 inline long atomic_fetch_or
2702 ( volatile atomic_long* __a__, long __m__ )
2703 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2706 inline long atomic_fetch_xor_explicit
2707 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2708 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2710 inline long atomic_fetch_xor
2711 ( volatile atomic_long* __a__, long __m__ )
2712 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2715 inline unsigned long atomic_fetch_add_explicit
2716 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2717 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2719 inline unsigned long atomic_fetch_add
2720 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2721 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2724 inline unsigned long atomic_fetch_sub_explicit
2725 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2726 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2728 inline unsigned long atomic_fetch_sub
2729 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2730 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2733 inline unsigned long atomic_fetch_and_explicit
2734 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2735 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2737 inline unsigned long atomic_fetch_and
2738 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2739 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2742 inline unsigned long atomic_fetch_or_explicit
2743 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2744 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2746 inline unsigned long atomic_fetch_or
2747 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2748 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2751 inline unsigned long atomic_fetch_xor_explicit
2752 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2753 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2755 inline unsigned long atomic_fetch_xor
2756 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2757 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2760 inline long long atomic_fetch_add_explicit
2761 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2762 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2764 inline long long atomic_fetch_add
2765 ( volatile atomic_llong* __a__, long long __m__ )
2766 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2769 inline long long atomic_fetch_sub_explicit
2770 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2771 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2773 inline long long atomic_fetch_sub
2774 ( volatile atomic_llong* __a__, long long __m__ )
2775 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2778 inline long long atomic_fetch_and_explicit
2779 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2780 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2782 inline long long atomic_fetch_and
2783 ( volatile atomic_llong* __a__, long long __m__ )
2784 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2787 inline long long atomic_fetch_or_explicit
2788 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2789 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2791 inline long long atomic_fetch_or
2792 ( volatile atomic_llong* __a__, long long __m__ )
2793 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2796 inline long long atomic_fetch_xor_explicit
2797 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2798 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2800 inline long long atomic_fetch_xor
2801 ( volatile atomic_llong* __a__, long long __m__ )
2802 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2805 inline unsigned long long atomic_fetch_add_explicit
2806 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2807 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2809 inline unsigned long long atomic_fetch_add
2810 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2811 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2814 inline unsigned long long atomic_fetch_sub_explicit
2815 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2816 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2818 inline unsigned long long atomic_fetch_sub
2819 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2820 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2823 inline unsigned long long atomic_fetch_and_explicit
2824 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2825 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2827 inline unsigned long long atomic_fetch_and
2828 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2829 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2832 inline unsigned long long atomic_fetch_or_explicit
2833 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2834 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2836 inline unsigned long long atomic_fetch_or
2837 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2838 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2841 inline unsigned long long atomic_fetch_xor_explicit
2842 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2843 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2845 inline unsigned long long atomic_fetch_xor
2846 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2847 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2850 inline wchar_t atomic_fetch_add_explicit
2851 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2852 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2854 inline wchar_t atomic_fetch_add
2855 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2856 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2859 inline wchar_t atomic_fetch_sub_explicit
2860 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2861 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2863 inline wchar_t atomic_fetch_sub
2864 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2865 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2868 inline wchar_t atomic_fetch_and_explicit
2869 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2870 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2872 inline wchar_t atomic_fetch_and
2873 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2874 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2877 inline wchar_t atomic_fetch_or_explicit
2878 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2879 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2881 inline wchar_t atomic_fetch_or
2882 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2883 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2886 inline wchar_t atomic_fetch_xor_explicit
2887 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2888 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2890 inline wchar_t atomic_fetch_xor
2891 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2892 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2898 #define atomic_is_lock_free( __a__ ) \
2901 #define atomic_load( __a__ ) \
2902 _ATOMIC_LOAD_( __a__, memory_order_seq_cst )
2904 #define atomic_load_explicit( __a__, __x__ ) \
2905 _ATOMIC_LOAD_( __a__, __x__ )
2907 #define atomic_init( __a__, __m__ ) \
2908 _ATOMIC_INIT_( __a__, __m__ )
2910 #define atomic_store( __a__, __m__ ) \
2911 _ATOMIC_STORE_( __a__, __m__, memory_order_seq_cst )
2913 #define atomic_store_explicit( __a__, __m__, __x__ ) \
2914 _ATOMIC_STORE_( __a__, __m__, __x__ )
2916 #define atomic_exchange( __a__, __m__ ) \
2917 _ATOMIC_MODIFY_( __a__, =, __m__, memory_order_seq_cst )
2919 #define atomic_exchange_explicit( __a__, __m__, __x__ ) \
2920 _ATOMIC_MODIFY_( __a__, =, __m__, __x__ )
2922 #define atomic_compare_exchange_weak( __a__, __e__, __m__ ) \
2923 _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, memory_order_seq_cst )
2925 #define atomic_compare_exchange_strong( __a__, __e__, __m__ ) \
2926 _ATOMIC_CMPSWP_( __a__, __e__, __m__, memory_order_seq_cst )
2928 #define atomic_compare_exchange_weak_explicit( __a__, __e__, __m__, __x__, __y__ ) \
2929 _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ )
2931 #define atomic_compare_exchange_strong_explicit( __a__, __e__, __m__, __x__, __y__ ) \
2932 _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )
2935 #define atomic_fetch_add_explicit( __a__, __m__, __x__ ) \
2936 _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ )
2938 #define atomic_fetch_add( __a__, __m__ ) \
2939 _ATOMIC_MODIFY_( __a__, +=, __m__, memory_order_seq_cst )
2942 #define atomic_fetch_sub_explicit( __a__, __m__, __x__ ) \
2943 _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ )
2945 #define atomic_fetch_sub( __a__, __m__ ) \
2946 _ATOMIC_MODIFY_( __a__, -=, __m__, memory_order_seq_cst )
2949 #define atomic_fetch_and_explicit( __a__, __m__, __x__ ) \
2950 _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ )
2952 #define atomic_fetch_and( __a__, __m__ ) \
2953 _ATOMIC_MODIFY_( __a__, &=, __m__, memory_order_seq_cst )
2956 #define atomic_fetch_or_explicit( __a__, __m__, __x__ ) \
2957 _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ )
2959 #define atomic_fetch_or( __a__, __m__ ) \
2960 _ATOMIC_MODIFY_( __a__, |=, __m__, memory_order_seq_cst )
2963 #define atomic_fetch_xor_explicit( __a__, __m__, __x__ ) \
2964 _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ )
2966 #define atomic_fetch_xor( __a__, __m__ ) \
2967 _ATOMIC_MODIFY_( __a__, ^=, __m__, memory_order_seq_cst )
2976 inline bool atomic_bool::is_lock_free() const volatile
2979 inline void atomic_bool::store
2980 ( bool __m__, memory_order __x__ ) volatile
2981 { atomic_store_explicit( this, __m__, __x__ ); }
2983 inline bool atomic_bool::load
2984 ( memory_order __x__ ) volatile
2985 { return atomic_load_explicit( this, __x__ ); }
2987 inline bool atomic_bool::exchange
2988 ( bool __m__, memory_order __x__ ) volatile
2989 { return atomic_exchange_explicit( this, __m__, __x__ ); }
2991 inline bool atomic_bool::compare_exchange_weak
2992 ( bool& __e__, bool __m__,
2993 memory_order __x__, memory_order __y__ ) volatile
2994 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
2996 inline bool atomic_bool::compare_exchange_strong
2997 ( bool& __e__, bool __m__,
2998 memory_order __x__, memory_order __y__ ) volatile
2999 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3001 inline bool atomic_bool::compare_exchange_weak
3002 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
3003 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3004 __x__ == memory_order_acq_rel ? memory_order_acquire :
3005 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3007 inline bool atomic_bool::compare_exchange_strong
3008 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
3009 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3010 __x__ == memory_order_acq_rel ? memory_order_acquire :
3011 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3014 inline bool atomic_address::is_lock_free() const volatile
3017 inline void atomic_address::store
3018 ( void* __m__, memory_order __x__ ) volatile
3019 { atomic_store_explicit( this, __m__, __x__ ); }
3021 inline void* atomic_address::load
3022 ( memory_order __x__ ) volatile
3023 { return atomic_load_explicit( this, __x__ ); }
3025 inline void* atomic_address::exchange
3026 ( void* __m__, memory_order __x__ ) volatile
3027 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3029 inline bool atomic_address::compare_exchange_weak
3030 ( void*& __e__, void* __m__,
3031 memory_order __x__, memory_order __y__ ) volatile
3032 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3034 inline bool atomic_address::compare_exchange_strong
3035 ( void*& __e__, void* __m__,
3036 memory_order __x__, memory_order __y__ ) volatile
3037 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3039 inline bool atomic_address::compare_exchange_weak
3040 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
3041 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3042 __x__ == memory_order_acq_rel ? memory_order_acquire :
3043 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3045 inline bool atomic_address::compare_exchange_strong
3046 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
3047 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3048 __x__ == memory_order_acq_rel ? memory_order_acquire :
3049 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3052 inline bool atomic_char::is_lock_free() const volatile
3055 inline void atomic_char::store
3056 ( char __m__, memory_order __x__ ) volatile
3057 { atomic_store_explicit( this, __m__, __x__ ); }
3059 inline char atomic_char::load
3060 ( memory_order __x__ ) volatile
3061 { return atomic_load_explicit( this, __x__ ); }
3063 inline char atomic_char::exchange
3064 ( char __m__, memory_order __x__ ) volatile
3065 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3067 inline bool atomic_char::compare_exchange_weak
3068 ( char& __e__, char __m__,
3069 memory_order __x__, memory_order __y__ ) volatile
3070 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3072 inline bool atomic_char::compare_exchange_strong
3073 ( char& __e__, char __m__,
3074 memory_order __x__, memory_order __y__ ) volatile
3075 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3077 inline bool atomic_char::compare_exchange_weak
3078 ( char& __e__, char __m__, memory_order __x__ ) volatile
3079 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3080 __x__ == memory_order_acq_rel ? memory_order_acquire :
3081 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3083 inline bool atomic_char::compare_exchange_strong
3084 ( char& __e__, char __m__, memory_order __x__ ) volatile
3085 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3086 __x__ == memory_order_acq_rel ? memory_order_acquire :
3087 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3090 inline bool atomic_schar::is_lock_free() const volatile
3093 inline void atomic_schar::store
3094 ( signed char __m__, memory_order __x__ ) volatile
3095 { atomic_store_explicit( this, __m__, __x__ ); }
3097 inline signed char atomic_schar::load
3098 ( memory_order __x__ ) volatile
3099 { return atomic_load_explicit( this, __x__ ); }
3101 inline signed char atomic_schar::exchange
3102 ( signed char __m__, memory_order __x__ ) volatile
3103 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3105 inline bool atomic_schar::compare_exchange_weak
3106 ( signed char& __e__, signed char __m__,
3107 memory_order __x__, memory_order __y__ ) volatile
3108 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3110 inline bool atomic_schar::compare_exchange_strong
3111 ( signed char& __e__, signed char __m__,
3112 memory_order __x__, memory_order __y__ ) volatile
3113 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3115 inline bool atomic_schar::compare_exchange_weak
3116 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
3117 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3118 __x__ == memory_order_acq_rel ? memory_order_acquire :
3119 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3121 inline bool atomic_schar::compare_exchange_strong
3122 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
3123 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3124 __x__ == memory_order_acq_rel ? memory_order_acquire :
3125 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3128 inline bool atomic_uchar::is_lock_free() const volatile
3131 inline void atomic_uchar::store
3132 ( unsigned char __m__, memory_order __x__ ) volatile
3133 { atomic_store_explicit( this, __m__, __x__ ); }
3135 inline unsigned char atomic_uchar::load
3136 ( memory_order __x__ ) volatile
3137 { return atomic_load_explicit( this, __x__ ); }
3139 inline unsigned char atomic_uchar::exchange
3140 ( unsigned char __m__, memory_order __x__ ) volatile
3141 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3143 inline bool atomic_uchar::compare_exchange_weak
3144 ( unsigned char& __e__, unsigned char __m__,
3145 memory_order __x__, memory_order __y__ ) volatile
3146 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3148 inline bool atomic_uchar::compare_exchange_strong
3149 ( unsigned char& __e__, unsigned char __m__,
3150 memory_order __x__, memory_order __y__ ) volatile
3151 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3153 inline bool atomic_uchar::compare_exchange_weak
3154 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
3155 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3156 __x__ == memory_order_acq_rel ? memory_order_acquire :
3157 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3159 inline bool atomic_uchar::compare_exchange_strong
3160 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
3161 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3162 __x__ == memory_order_acq_rel ? memory_order_acquire :
3163 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3166 inline bool atomic_short::is_lock_free() const volatile
3169 inline void atomic_short::store
3170 ( short __m__, memory_order __x__ ) volatile
3171 { atomic_store_explicit( this, __m__, __x__ ); }
3173 inline short atomic_short::load
3174 ( memory_order __x__ ) volatile
3175 { return atomic_load_explicit( this, __x__ ); }
3177 inline short atomic_short::exchange
3178 ( short __m__, memory_order __x__ ) volatile
3179 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3181 inline bool atomic_short::compare_exchange_weak
3182 ( short& __e__, short __m__,
3183 memory_order __x__, memory_order __y__ ) volatile
3184 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3186 inline bool atomic_short::compare_exchange_strong
3187 ( short& __e__, short __m__,
3188 memory_order __x__, memory_order __y__ ) volatile
3189 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3191 inline bool atomic_short::compare_exchange_weak
3192 ( short& __e__, short __m__, memory_order __x__ ) volatile
3193 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3194 __x__ == memory_order_acq_rel ? memory_order_acquire :
3195 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3197 inline bool atomic_short::compare_exchange_strong
3198 ( short& __e__, short __m__, memory_order __x__ ) volatile
3199 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3200 __x__ == memory_order_acq_rel ? memory_order_acquire :
3201 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3204 inline bool atomic_ushort::is_lock_free() const volatile
3207 inline void atomic_ushort::store
3208 ( unsigned short __m__, memory_order __x__ ) volatile
3209 { atomic_store_explicit( this, __m__, __x__ ); }
3211 inline unsigned short atomic_ushort::load
3212 ( memory_order __x__ ) volatile
3213 { return atomic_load_explicit( this, __x__ ); }
3215 inline unsigned short atomic_ushort::exchange
3216 ( unsigned short __m__, memory_order __x__ ) volatile
3217 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3219 inline bool atomic_ushort::compare_exchange_weak
3220 ( unsigned short& __e__, unsigned short __m__,
3221 memory_order __x__, memory_order __y__ ) volatile
3222 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3224 inline bool atomic_ushort::compare_exchange_strong
3225 ( unsigned short& __e__, unsigned short __m__,
3226 memory_order __x__, memory_order __y__ ) volatile
3227 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3229 inline bool atomic_ushort::compare_exchange_weak
3230 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
3231 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3232 __x__ == memory_order_acq_rel ? memory_order_acquire :
3233 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3235 inline bool atomic_ushort::compare_exchange_strong
3236 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
3237 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3238 __x__ == memory_order_acq_rel ? memory_order_acquire :
3239 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3242 inline bool atomic_int::is_lock_free() const volatile
3245 inline void atomic_int::store
3246 ( int __m__, memory_order __x__ ) volatile
3247 { atomic_store_explicit( this, __m__, __x__ ); }
3249 inline int atomic_int::load
3250 ( memory_order __x__ ) volatile
3251 { return atomic_load_explicit( this, __x__ ); }
3253 inline int atomic_int::exchange
3254 ( int __m__, memory_order __x__ ) volatile
3255 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3257 inline bool atomic_int::compare_exchange_weak
3258 ( int& __e__, int __m__,
3259 memory_order __x__, memory_order __y__ ) volatile
3260 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3262 inline bool atomic_int::compare_exchange_strong
3263 ( int& __e__, int __m__,
3264 memory_order __x__, memory_order __y__ ) volatile
3265 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3267 inline bool atomic_int::compare_exchange_weak
3268 ( int& __e__, int __m__, memory_order __x__ ) volatile
3269 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3270 __x__ == memory_order_acq_rel ? memory_order_acquire :
3271 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3273 inline bool atomic_int::compare_exchange_strong
3274 ( int& __e__, int __m__, memory_order __x__ ) volatile
3275 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3276 __x__ == memory_order_acq_rel ? memory_order_acquire :
3277 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3280 inline bool atomic_uint::is_lock_free() const volatile
3283 inline void atomic_uint::store
3284 ( unsigned int __m__, memory_order __x__ ) volatile
3285 { atomic_store_explicit( this, __m__, __x__ ); }
3287 inline unsigned int atomic_uint::load
3288 ( memory_order __x__ ) volatile
3289 { return atomic_load_explicit( this, __x__ ); }
3291 inline unsigned int atomic_uint::exchange
3292 ( unsigned int __m__, memory_order __x__ ) volatile
3293 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3295 inline bool atomic_uint::compare_exchange_weak
3296 ( unsigned int& __e__, unsigned int __m__,
3297 memory_order __x__, memory_order __y__ ) volatile
3298 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3300 inline bool atomic_uint::compare_exchange_strong
3301 ( unsigned int& __e__, unsigned int __m__,
3302 memory_order __x__, memory_order __y__ ) volatile
3303 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3305 inline bool atomic_uint::compare_exchange_weak
3306 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
3307 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3308 __x__ == memory_order_acq_rel ? memory_order_acquire :
3309 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3311 inline bool atomic_uint::compare_exchange_strong
3312 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
3313 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3314 __x__ == memory_order_acq_rel ? memory_order_acquire :
3315 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3318 inline bool atomic_long::is_lock_free() const volatile
3321 inline void atomic_long::store
3322 ( long __m__, memory_order __x__ ) volatile
3323 { atomic_store_explicit( this, __m__, __x__ ); }
3325 inline long atomic_long::load
3326 ( memory_order __x__ ) volatile
3327 { return atomic_load_explicit( this, __x__ ); }
3329 inline long atomic_long::exchange
3330 ( long __m__, memory_order __x__ ) volatile
3331 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3333 inline bool atomic_long::compare_exchange_weak
3334 ( long& __e__, long __m__,
3335 memory_order __x__, memory_order __y__ ) volatile
3336 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3338 inline bool atomic_long::compare_exchange_strong
3339 ( long& __e__, long __m__,
3340 memory_order __x__, memory_order __y__ ) volatile
3341 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3343 inline bool atomic_long::compare_exchange_weak
3344 ( long& __e__, long __m__, memory_order __x__ ) volatile
3345 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3346 __x__ == memory_order_acq_rel ? memory_order_acquire :
3347 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3349 inline bool atomic_long::compare_exchange_strong
3350 ( long& __e__, long __m__, memory_order __x__ ) volatile
3351 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3352 __x__ == memory_order_acq_rel ? memory_order_acquire :
3353 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3356 inline bool atomic_ulong::is_lock_free() const volatile
3359 inline void atomic_ulong::store
3360 ( unsigned long __m__, memory_order __x__ ) volatile
3361 { atomic_store_explicit( this, __m__, __x__ ); }
3363 inline unsigned long atomic_ulong::load
3364 ( memory_order __x__ ) volatile
3365 { return atomic_load_explicit( this, __x__ ); }
3367 inline unsigned long atomic_ulong::exchange
3368 ( unsigned long __m__, memory_order __x__ ) volatile
3369 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3371 inline bool atomic_ulong::compare_exchange_weak
3372 ( unsigned long& __e__, unsigned long __m__,
3373 memory_order __x__, memory_order __y__ ) volatile
3374 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3376 inline bool atomic_ulong::compare_exchange_strong
3377 ( unsigned long& __e__, unsigned long __m__,
3378 memory_order __x__, memory_order __y__ ) volatile
3379 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3381 inline bool atomic_ulong::compare_exchange_weak
3382 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
3383 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3384 __x__ == memory_order_acq_rel ? memory_order_acquire :
3385 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3387 inline bool atomic_ulong::compare_exchange_strong
3388 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
3389 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3390 __x__ == memory_order_acq_rel ? memory_order_acquire :
3391 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3394 inline bool atomic_llong::is_lock_free() const volatile
3397 inline void atomic_llong::store
3398 ( long long __m__, memory_order __x__ ) volatile
3399 { atomic_store_explicit( this, __m__, __x__ ); }
3401 inline long long atomic_llong::load
3402 ( memory_order __x__ ) volatile
3403 { return atomic_load_explicit( this, __x__ ); }
3405 inline long long atomic_llong::exchange
3406 ( long long __m__, memory_order __x__ ) volatile
3407 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3409 inline bool atomic_llong::compare_exchange_weak
3410 ( long long& __e__, long long __m__,
3411 memory_order __x__, memory_order __y__ ) volatile
3412 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3414 inline bool atomic_llong::compare_exchange_strong
3415 ( long long& __e__, long long __m__,
3416 memory_order __x__, memory_order __y__ ) volatile
3417 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3419 inline bool atomic_llong::compare_exchange_weak
3420 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
3421 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3422 __x__ == memory_order_acq_rel ? memory_order_acquire :
3423 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3425 inline bool atomic_llong::compare_exchange_strong
3426 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
3427 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3428 __x__ == memory_order_acq_rel ? memory_order_acquire :
3429 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3432 inline bool atomic_ullong::is_lock_free() const volatile
3435 inline void atomic_ullong::store
3436 ( unsigned long long __m__, memory_order __x__ ) volatile
3437 { atomic_store_explicit( this, __m__, __x__ ); }
3439 inline unsigned long long atomic_ullong::load
3440 ( memory_order __x__ ) volatile
3441 { return atomic_load_explicit( this, __x__ ); }
3443 inline unsigned long long atomic_ullong::exchange
3444 ( unsigned long long __m__, memory_order __x__ ) volatile
3445 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3447 inline bool atomic_ullong::compare_exchange_weak
3448 ( unsigned long long& __e__, unsigned long long __m__,
3449 memory_order __x__, memory_order __y__ ) volatile
3450 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3452 inline bool atomic_ullong::compare_exchange_strong
3453 ( unsigned long long& __e__, unsigned long long __m__,
3454 memory_order __x__, memory_order __y__ ) volatile
3455 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3457 inline bool atomic_ullong::compare_exchange_weak
3458 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
3459 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3460 __x__ == memory_order_acq_rel ? memory_order_acquire :
3461 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3463 inline bool atomic_ullong::compare_exchange_strong
3464 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
3465 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3466 __x__ == memory_order_acq_rel ? memory_order_acquire :
3467 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3470 inline bool atomic_wchar_t::is_lock_free() const volatile
3473 inline void atomic_wchar_t::store
3474 ( wchar_t __m__, memory_order __x__ ) volatile
3475 { atomic_store_explicit( this, __m__, __x__ ); }
3477 inline wchar_t atomic_wchar_t::load
3478 ( memory_order __x__ ) volatile
3479 { return atomic_load_explicit( this, __x__ ); }
3481 inline wchar_t atomic_wchar_t::exchange
3482 ( wchar_t __m__, memory_order __x__ ) volatile
3483 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3485 inline bool atomic_wchar_t::compare_exchange_weak
3486 ( wchar_t& __e__, wchar_t __m__,
3487 memory_order __x__, memory_order __y__ ) volatile
3488 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3490 inline bool atomic_wchar_t::compare_exchange_strong
3491 ( wchar_t& __e__, wchar_t __m__,
3492 memory_order __x__, memory_order __y__ ) volatile
3493 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3495 inline bool atomic_wchar_t::compare_exchange_weak
3496 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
3497 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3498 __x__ == memory_order_acq_rel ? memory_order_acquire :
3499 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3501 inline bool atomic_wchar_t::compare_exchange_strong
3502 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
3503 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3504 __x__ == memory_order_acq_rel ? memory_order_acquire :
3505 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3508 template< typename T >
3509 inline bool atomic<T>::is_lock_free() const volatile
3512 template< typename T >
3513 inline void atomic<T>::store( T __v__, memory_order __x__ ) volatile
3514 { _ATOMIC_STORE_( this, __v__, __x__ ); }
3516 template< typename T >
3517 inline T atomic<T>::load( memory_order __x__ ) volatile
3518 { return _ATOMIC_LOAD_( this, __x__ ); }
3520 template< typename T >
3521 inline T atomic<T>::exchange( T __v__, memory_order __x__ ) volatile
3522 { return _ATOMIC_MODIFY_( this, =, __v__, __x__ ); }
3524 template< typename T >
3525 inline bool atomic<T>::compare_exchange_weak
3526 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
3527 { return _ATOMIC_CMPSWP_WEAK_( this, &__r__, __v__, __x__ ); }
3529 template< typename T >
3530 inline bool atomic<T>::compare_exchange_strong
3531 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
3532 { return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
3534 template< typename T >
3535 inline bool atomic<T>::compare_exchange_weak
3536 ( T& __r__, T __v__, memory_order __x__ ) volatile
3537 { return compare_exchange_weak( __r__, __v__, __x__,
3538 __x__ == memory_order_acq_rel ? memory_order_acquire :
3539 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3541 template< typename T >
3542 inline bool atomic<T>::compare_exchange_strong
3543 ( T& __r__, T __v__, memory_order __x__ ) volatile
3544 { return compare_exchange_strong( __r__, __v__, __x__,
3545 __x__ == memory_order_acq_rel ? memory_order_acquire :
3546 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3549 inline void* atomic_address::fetch_add
3550 ( ptrdiff_t __m__, memory_order __x__ ) volatile
3551 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }