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 volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__);
2334 __typeof__((__a__)->__f__) __old__=(__typeof__((__a__)->__f__)) model_rmwr_action((void *)__p__, __x__);
2335 __typeof__((__a__)->__f__) __copy__= __old__;
2336 __copy__ = (void *) (((char *)__copy__) + __m__);
2337 model_rmw_action((void *)__p__, __x__, (uint64_t) __copy__);
2341 inline void* atomic_fetch_add
2342 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
2343 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2346 inline void* atomic_fetch_sub_explicit
2347 ( volatile atomic_address* __a__, ptrdiff_t __m__, memory_order __x__ )
2348 { volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__);
2349 __typeof__((__a__)->__f__) __old__=(__typeof__((__a__)->__f__)) model_rmwr_action((void *)__p__, __x__);
2350 __typeof__((__a__)->__f__) __copy__= __old__;
2351 __copy__ = (void *) (((char *)__copy__) - __m__);
2352 model_rmw_action((void *)__p__, __x__, (uint64_t) __copy__);
2356 inline void* atomic_fetch_sub
2357 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
2358 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2360 inline char atomic_fetch_add_explicit
2361 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2362 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2364 inline char atomic_fetch_add
2365 ( volatile atomic_char* __a__, char __m__ )
2366 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2369 inline char atomic_fetch_sub_explicit
2370 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2371 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2373 inline char atomic_fetch_sub
2374 ( volatile atomic_char* __a__, char __m__ )
2375 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2378 inline char atomic_fetch_and_explicit
2379 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2380 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2382 inline char atomic_fetch_and
2383 ( volatile atomic_char* __a__, char __m__ )
2384 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2387 inline char atomic_fetch_or_explicit
2388 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2389 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2391 inline char atomic_fetch_or
2392 ( volatile atomic_char* __a__, char __m__ )
2393 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2396 inline char atomic_fetch_xor_explicit
2397 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
2398 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2400 inline char atomic_fetch_xor
2401 ( volatile atomic_char* __a__, char __m__ )
2402 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2405 inline signed char atomic_fetch_add_explicit
2406 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2407 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2409 inline signed char atomic_fetch_add
2410 ( volatile atomic_schar* __a__, signed char __m__ )
2411 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2414 inline signed char atomic_fetch_sub_explicit
2415 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2416 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2418 inline signed char atomic_fetch_sub
2419 ( volatile atomic_schar* __a__, signed char __m__ )
2420 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2423 inline signed char atomic_fetch_and_explicit
2424 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2425 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2427 inline signed char atomic_fetch_and
2428 ( volatile atomic_schar* __a__, signed char __m__ )
2429 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2432 inline signed char atomic_fetch_or_explicit
2433 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2434 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2436 inline signed char atomic_fetch_or
2437 ( volatile atomic_schar* __a__, signed char __m__ )
2438 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2441 inline signed char atomic_fetch_xor_explicit
2442 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
2443 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2445 inline signed char atomic_fetch_xor
2446 ( volatile atomic_schar* __a__, signed char __m__ )
2447 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2450 inline unsigned char atomic_fetch_add_explicit
2451 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2452 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2454 inline unsigned char atomic_fetch_add
2455 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2456 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2459 inline unsigned char atomic_fetch_sub_explicit
2460 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2461 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2463 inline unsigned char atomic_fetch_sub
2464 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2465 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2468 inline unsigned char atomic_fetch_and_explicit
2469 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2470 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2472 inline unsigned char atomic_fetch_and
2473 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2474 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2477 inline unsigned char atomic_fetch_or_explicit
2478 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2479 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2481 inline unsigned char atomic_fetch_or
2482 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2483 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2486 inline unsigned char atomic_fetch_xor_explicit
2487 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
2488 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2490 inline unsigned char atomic_fetch_xor
2491 ( volatile atomic_uchar* __a__, unsigned char __m__ )
2492 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2495 inline short atomic_fetch_add_explicit
2496 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2497 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2499 inline short atomic_fetch_add
2500 ( volatile atomic_short* __a__, short __m__ )
2501 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2504 inline short atomic_fetch_sub_explicit
2505 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2506 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2508 inline short atomic_fetch_sub
2509 ( volatile atomic_short* __a__, short __m__ )
2510 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2513 inline short atomic_fetch_and_explicit
2514 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2515 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2517 inline short atomic_fetch_and
2518 ( volatile atomic_short* __a__, short __m__ )
2519 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2522 inline short atomic_fetch_or_explicit
2523 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2524 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2526 inline short atomic_fetch_or
2527 ( volatile atomic_short* __a__, short __m__ )
2528 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2531 inline short atomic_fetch_xor_explicit
2532 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
2533 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2535 inline short atomic_fetch_xor
2536 ( volatile atomic_short* __a__, short __m__ )
2537 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2540 inline unsigned short atomic_fetch_add_explicit
2541 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2542 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2544 inline unsigned short atomic_fetch_add
2545 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2546 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2549 inline unsigned short atomic_fetch_sub_explicit
2550 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2551 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2553 inline unsigned short atomic_fetch_sub
2554 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2555 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2558 inline unsigned short atomic_fetch_and_explicit
2559 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2560 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2562 inline unsigned short atomic_fetch_and
2563 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2564 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2567 inline unsigned short atomic_fetch_or_explicit
2568 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2569 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2571 inline unsigned short atomic_fetch_or
2572 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2573 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2576 inline unsigned short atomic_fetch_xor_explicit
2577 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
2578 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2580 inline unsigned short atomic_fetch_xor
2581 ( volatile atomic_ushort* __a__, unsigned short __m__ )
2582 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2585 inline int atomic_fetch_add_explicit
2586 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2587 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2589 inline int atomic_fetch_add
2590 ( volatile atomic_int* __a__, int __m__ )
2591 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2594 inline int atomic_fetch_sub_explicit
2595 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2596 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2598 inline int atomic_fetch_sub
2599 ( volatile atomic_int* __a__, int __m__ )
2600 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2603 inline int atomic_fetch_and_explicit
2604 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2605 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2607 inline int atomic_fetch_and
2608 ( volatile atomic_int* __a__, int __m__ )
2609 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2612 inline int atomic_fetch_or_explicit
2613 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2614 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2616 inline int atomic_fetch_or
2617 ( volatile atomic_int* __a__, int __m__ )
2618 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2621 inline int atomic_fetch_xor_explicit
2622 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
2623 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2625 inline int atomic_fetch_xor
2626 ( volatile atomic_int* __a__, int __m__ )
2627 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2630 inline unsigned int atomic_fetch_add_explicit
2631 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2632 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2634 inline unsigned int atomic_fetch_add
2635 ( volatile atomic_uint* __a__, unsigned int __m__ )
2636 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2639 inline unsigned int atomic_fetch_sub_explicit
2640 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2641 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2643 inline unsigned int atomic_fetch_sub
2644 ( volatile atomic_uint* __a__, unsigned int __m__ )
2645 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2648 inline unsigned int atomic_fetch_and_explicit
2649 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2650 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2652 inline unsigned int atomic_fetch_and
2653 ( volatile atomic_uint* __a__, unsigned int __m__ )
2654 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2657 inline unsigned int atomic_fetch_or_explicit
2658 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2659 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2661 inline unsigned int atomic_fetch_or
2662 ( volatile atomic_uint* __a__, unsigned int __m__ )
2663 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2666 inline unsigned int atomic_fetch_xor_explicit
2667 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
2668 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2670 inline unsigned int atomic_fetch_xor
2671 ( volatile atomic_uint* __a__, unsigned int __m__ )
2672 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2675 inline long atomic_fetch_add_explicit
2676 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2677 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2679 inline long atomic_fetch_add
2680 ( volatile atomic_long* __a__, long __m__ )
2681 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2684 inline long atomic_fetch_sub_explicit
2685 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2686 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2688 inline long atomic_fetch_sub
2689 ( volatile atomic_long* __a__, long __m__ )
2690 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2693 inline long atomic_fetch_and_explicit
2694 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2695 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2697 inline long atomic_fetch_and
2698 ( volatile atomic_long* __a__, long __m__ )
2699 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2702 inline long atomic_fetch_or_explicit
2703 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2704 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2706 inline long atomic_fetch_or
2707 ( volatile atomic_long* __a__, long __m__ )
2708 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2711 inline long atomic_fetch_xor_explicit
2712 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
2713 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2715 inline long atomic_fetch_xor
2716 ( volatile atomic_long* __a__, long __m__ )
2717 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2720 inline unsigned long atomic_fetch_add_explicit
2721 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2722 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2724 inline unsigned long atomic_fetch_add
2725 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2726 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2729 inline unsigned long atomic_fetch_sub_explicit
2730 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2731 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2733 inline unsigned long atomic_fetch_sub
2734 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2735 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2738 inline unsigned long atomic_fetch_and_explicit
2739 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2740 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2742 inline unsigned long atomic_fetch_and
2743 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2744 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2747 inline unsigned long atomic_fetch_or_explicit
2748 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2749 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2751 inline unsigned long atomic_fetch_or
2752 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2753 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2756 inline unsigned long atomic_fetch_xor_explicit
2757 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
2758 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2760 inline unsigned long atomic_fetch_xor
2761 ( volatile atomic_ulong* __a__, unsigned long __m__ )
2762 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2765 inline long long atomic_fetch_add_explicit
2766 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2767 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2769 inline long long atomic_fetch_add
2770 ( volatile atomic_llong* __a__, long long __m__ )
2771 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2774 inline long long atomic_fetch_sub_explicit
2775 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2776 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2778 inline long long atomic_fetch_sub
2779 ( volatile atomic_llong* __a__, long long __m__ )
2780 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2783 inline long long atomic_fetch_and_explicit
2784 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2785 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2787 inline long long atomic_fetch_and
2788 ( volatile atomic_llong* __a__, long long __m__ )
2789 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2792 inline long long atomic_fetch_or_explicit
2793 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2794 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2796 inline long long atomic_fetch_or
2797 ( volatile atomic_llong* __a__, long long __m__ )
2798 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2801 inline long long atomic_fetch_xor_explicit
2802 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
2803 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2805 inline long long atomic_fetch_xor
2806 ( volatile atomic_llong* __a__, long long __m__ )
2807 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2810 inline unsigned long long atomic_fetch_add_explicit
2811 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2812 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2814 inline unsigned long long atomic_fetch_add
2815 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2816 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2819 inline unsigned long long atomic_fetch_sub_explicit
2820 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2821 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2823 inline unsigned long long atomic_fetch_sub
2824 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2825 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2828 inline unsigned long long atomic_fetch_and_explicit
2829 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2830 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2832 inline unsigned long long atomic_fetch_and
2833 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2834 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2837 inline unsigned long long atomic_fetch_or_explicit
2838 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2839 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2841 inline unsigned long long atomic_fetch_or
2842 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2843 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2846 inline unsigned long long atomic_fetch_xor_explicit
2847 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
2848 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2850 inline unsigned long long atomic_fetch_xor
2851 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
2852 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2855 inline wchar_t atomic_fetch_add_explicit
2856 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2857 { return _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ ); }
2859 inline wchar_t atomic_fetch_add
2860 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2861 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
2864 inline wchar_t atomic_fetch_sub_explicit
2865 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2866 { return _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ ); }
2868 inline wchar_t atomic_fetch_sub
2869 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2870 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
2873 inline wchar_t atomic_fetch_and_explicit
2874 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2875 { return _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ ); }
2877 inline wchar_t atomic_fetch_and
2878 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2879 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
2882 inline wchar_t atomic_fetch_or_explicit
2883 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2884 { return _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ ); }
2886 inline wchar_t atomic_fetch_or
2887 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2888 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
2891 inline wchar_t atomic_fetch_xor_explicit
2892 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
2893 { return _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ ); }
2895 inline wchar_t atomic_fetch_xor
2896 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
2897 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
2903 #define atomic_is_lock_free( __a__ ) \
2906 #define atomic_load( __a__ ) \
2907 _ATOMIC_LOAD_( __a__, memory_order_seq_cst )
2909 #define atomic_load_explicit( __a__, __x__ ) \
2910 _ATOMIC_LOAD_( __a__, __x__ )
2912 #define atomic_init( __a__, __m__ ) \
2913 _ATOMIC_INIT_( __a__, __m__ )
2915 #define atomic_store( __a__, __m__ ) \
2916 _ATOMIC_STORE_( __a__, __m__, memory_order_seq_cst )
2918 #define atomic_store_explicit( __a__, __m__, __x__ ) \
2919 _ATOMIC_STORE_( __a__, __m__, __x__ )
2921 #define atomic_exchange( __a__, __m__ ) \
2922 _ATOMIC_MODIFY_( __a__, =, __m__, memory_order_seq_cst )
2924 #define atomic_exchange_explicit( __a__, __m__, __x__ ) \
2925 _ATOMIC_MODIFY_( __a__, =, __m__, __x__ )
2927 #define atomic_compare_exchange_weak( __a__, __e__, __m__ ) \
2928 _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, memory_order_seq_cst )
2930 #define atomic_compare_exchange_strong( __a__, __e__, __m__ ) \
2931 _ATOMIC_CMPSWP_( __a__, __e__, __m__, memory_order_seq_cst )
2933 #define atomic_compare_exchange_weak_explicit( __a__, __e__, __m__, __x__, __y__ ) \
2934 _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ )
2936 #define atomic_compare_exchange_strong_explicit( __a__, __e__, __m__, __x__, __y__ ) \
2937 _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )
2940 #define atomic_fetch_add_explicit( __a__, __m__, __x__ ) \
2941 _ATOMIC_MODIFY_( __a__, +=, __m__, __x__ )
2943 #define atomic_fetch_add( __a__, __m__ ) \
2944 _ATOMIC_MODIFY_( __a__, +=, __m__, memory_order_seq_cst )
2947 #define atomic_fetch_sub_explicit( __a__, __m__, __x__ ) \
2948 _ATOMIC_MODIFY_( __a__, -=, __m__, __x__ )
2950 #define atomic_fetch_sub( __a__, __m__ ) \
2951 _ATOMIC_MODIFY_( __a__, -=, __m__, memory_order_seq_cst )
2954 #define atomic_fetch_and_explicit( __a__, __m__, __x__ ) \
2955 _ATOMIC_MODIFY_( __a__, &=, __m__, __x__ )
2957 #define atomic_fetch_and( __a__, __m__ ) \
2958 _ATOMIC_MODIFY_( __a__, &=, __m__, memory_order_seq_cst )
2961 #define atomic_fetch_or_explicit( __a__, __m__, __x__ ) \
2962 _ATOMIC_MODIFY_( __a__, |=, __m__, __x__ )
2964 #define atomic_fetch_or( __a__, __m__ ) \
2965 _ATOMIC_MODIFY_( __a__, |=, __m__, memory_order_seq_cst )
2968 #define atomic_fetch_xor_explicit( __a__, __m__, __x__ ) \
2969 _ATOMIC_MODIFY_( __a__, ^=, __m__, __x__ )
2971 #define atomic_fetch_xor( __a__, __m__ ) \
2972 _ATOMIC_MODIFY_( __a__, ^=, __m__, memory_order_seq_cst )
2981 inline bool atomic_bool::is_lock_free() const volatile
2984 inline void atomic_bool::store
2985 ( bool __m__, memory_order __x__ ) volatile
2986 { atomic_store_explicit( this, __m__, __x__ ); }
2988 inline bool atomic_bool::load
2989 ( memory_order __x__ ) volatile
2990 { return atomic_load_explicit( this, __x__ ); }
2992 inline bool atomic_bool::exchange
2993 ( bool __m__, memory_order __x__ ) volatile
2994 { return atomic_exchange_explicit( this, __m__, __x__ ); }
2996 inline bool atomic_bool::compare_exchange_weak
2997 ( bool& __e__, bool __m__,
2998 memory_order __x__, memory_order __y__ ) volatile
2999 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3001 inline bool atomic_bool::compare_exchange_strong
3002 ( bool& __e__, bool __m__,
3003 memory_order __x__, memory_order __y__ ) volatile
3004 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3006 inline bool atomic_bool::compare_exchange_weak
3007 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
3008 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3009 __x__ == memory_order_acq_rel ? memory_order_acquire :
3010 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3012 inline bool atomic_bool::compare_exchange_strong
3013 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
3014 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3015 __x__ == memory_order_acq_rel ? memory_order_acquire :
3016 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3019 inline bool atomic_address::is_lock_free() const volatile
3022 inline void atomic_address::store
3023 ( void* __m__, memory_order __x__ ) volatile
3024 { atomic_store_explicit( this, __m__, __x__ ); }
3026 inline void* atomic_address::load
3027 ( memory_order __x__ ) volatile
3028 { return atomic_load_explicit( this, __x__ ); }
3030 inline void* atomic_address::exchange
3031 ( void* __m__, memory_order __x__ ) volatile
3032 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3034 inline bool atomic_address::compare_exchange_weak
3035 ( void*& __e__, void* __m__,
3036 memory_order __x__, memory_order __y__ ) volatile
3037 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3039 inline bool atomic_address::compare_exchange_strong
3040 ( void*& __e__, void* __m__,
3041 memory_order __x__, memory_order __y__ ) volatile
3042 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3044 inline bool atomic_address::compare_exchange_weak
3045 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
3046 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3047 __x__ == memory_order_acq_rel ? memory_order_acquire :
3048 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3050 inline bool atomic_address::compare_exchange_strong
3051 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
3052 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3053 __x__ == memory_order_acq_rel ? memory_order_acquire :
3054 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3057 inline bool atomic_char::is_lock_free() const volatile
3060 inline void atomic_char::store
3061 ( char __m__, memory_order __x__ ) volatile
3062 { atomic_store_explicit( this, __m__, __x__ ); }
3064 inline char atomic_char::load
3065 ( memory_order __x__ ) volatile
3066 { return atomic_load_explicit( this, __x__ ); }
3068 inline char atomic_char::exchange
3069 ( char __m__, memory_order __x__ ) volatile
3070 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3072 inline bool atomic_char::compare_exchange_weak
3073 ( char& __e__, char __m__,
3074 memory_order __x__, memory_order __y__ ) volatile
3075 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3077 inline bool atomic_char::compare_exchange_strong
3078 ( char& __e__, char __m__,
3079 memory_order __x__, memory_order __y__ ) volatile
3080 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3082 inline bool atomic_char::compare_exchange_weak
3083 ( char& __e__, char __m__, memory_order __x__ ) volatile
3084 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3085 __x__ == memory_order_acq_rel ? memory_order_acquire :
3086 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3088 inline bool atomic_char::compare_exchange_strong
3089 ( char& __e__, char __m__, memory_order __x__ ) volatile
3090 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3091 __x__ == memory_order_acq_rel ? memory_order_acquire :
3092 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3095 inline bool atomic_schar::is_lock_free() const volatile
3098 inline void atomic_schar::store
3099 ( signed char __m__, memory_order __x__ ) volatile
3100 { atomic_store_explicit( this, __m__, __x__ ); }
3102 inline signed char atomic_schar::load
3103 ( memory_order __x__ ) volatile
3104 { return atomic_load_explicit( this, __x__ ); }
3106 inline signed char atomic_schar::exchange
3107 ( signed char __m__, memory_order __x__ ) volatile
3108 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3110 inline bool atomic_schar::compare_exchange_weak
3111 ( signed char& __e__, signed char __m__,
3112 memory_order __x__, memory_order __y__ ) volatile
3113 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3115 inline bool atomic_schar::compare_exchange_strong
3116 ( signed char& __e__, signed char __m__,
3117 memory_order __x__, memory_order __y__ ) volatile
3118 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3120 inline bool atomic_schar::compare_exchange_weak
3121 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
3122 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3123 __x__ == memory_order_acq_rel ? memory_order_acquire :
3124 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3126 inline bool atomic_schar::compare_exchange_strong
3127 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
3128 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3129 __x__ == memory_order_acq_rel ? memory_order_acquire :
3130 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3133 inline bool atomic_uchar::is_lock_free() const volatile
3136 inline void atomic_uchar::store
3137 ( unsigned char __m__, memory_order __x__ ) volatile
3138 { atomic_store_explicit( this, __m__, __x__ ); }
3140 inline unsigned char atomic_uchar::load
3141 ( memory_order __x__ ) volatile
3142 { return atomic_load_explicit( this, __x__ ); }
3144 inline unsigned char atomic_uchar::exchange
3145 ( unsigned char __m__, memory_order __x__ ) volatile
3146 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3148 inline bool atomic_uchar::compare_exchange_weak
3149 ( unsigned char& __e__, unsigned char __m__,
3150 memory_order __x__, memory_order __y__ ) volatile
3151 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3153 inline bool atomic_uchar::compare_exchange_strong
3154 ( unsigned char& __e__, unsigned char __m__,
3155 memory_order __x__, memory_order __y__ ) volatile
3156 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3158 inline bool atomic_uchar::compare_exchange_weak
3159 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
3160 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3161 __x__ == memory_order_acq_rel ? memory_order_acquire :
3162 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3164 inline bool atomic_uchar::compare_exchange_strong
3165 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
3166 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3167 __x__ == memory_order_acq_rel ? memory_order_acquire :
3168 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3171 inline bool atomic_short::is_lock_free() const volatile
3174 inline void atomic_short::store
3175 ( short __m__, memory_order __x__ ) volatile
3176 { atomic_store_explicit( this, __m__, __x__ ); }
3178 inline short atomic_short::load
3179 ( memory_order __x__ ) volatile
3180 { return atomic_load_explicit( this, __x__ ); }
3182 inline short atomic_short::exchange
3183 ( short __m__, memory_order __x__ ) volatile
3184 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3186 inline bool atomic_short::compare_exchange_weak
3187 ( short& __e__, short __m__,
3188 memory_order __x__, memory_order __y__ ) volatile
3189 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3191 inline bool atomic_short::compare_exchange_strong
3192 ( short& __e__, short __m__,
3193 memory_order __x__, memory_order __y__ ) volatile
3194 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3196 inline bool atomic_short::compare_exchange_weak
3197 ( short& __e__, short __m__, memory_order __x__ ) volatile
3198 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3199 __x__ == memory_order_acq_rel ? memory_order_acquire :
3200 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3202 inline bool atomic_short::compare_exchange_strong
3203 ( short& __e__, short __m__, memory_order __x__ ) volatile
3204 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3205 __x__ == memory_order_acq_rel ? memory_order_acquire :
3206 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3209 inline bool atomic_ushort::is_lock_free() const volatile
3212 inline void atomic_ushort::store
3213 ( unsigned short __m__, memory_order __x__ ) volatile
3214 { atomic_store_explicit( this, __m__, __x__ ); }
3216 inline unsigned short atomic_ushort::load
3217 ( memory_order __x__ ) volatile
3218 { return atomic_load_explicit( this, __x__ ); }
3220 inline unsigned short atomic_ushort::exchange
3221 ( unsigned short __m__, memory_order __x__ ) volatile
3222 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3224 inline bool atomic_ushort::compare_exchange_weak
3225 ( unsigned short& __e__, unsigned short __m__,
3226 memory_order __x__, memory_order __y__ ) volatile
3227 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3229 inline bool atomic_ushort::compare_exchange_strong
3230 ( unsigned short& __e__, unsigned short __m__,
3231 memory_order __x__, memory_order __y__ ) volatile
3232 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3234 inline bool atomic_ushort::compare_exchange_weak
3235 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
3236 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3237 __x__ == memory_order_acq_rel ? memory_order_acquire :
3238 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3240 inline bool atomic_ushort::compare_exchange_strong
3241 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
3242 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3243 __x__ == memory_order_acq_rel ? memory_order_acquire :
3244 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3247 inline bool atomic_int::is_lock_free() const volatile
3250 inline void atomic_int::store
3251 ( int __m__, memory_order __x__ ) volatile
3252 { atomic_store_explicit( this, __m__, __x__ ); }
3254 inline int atomic_int::load
3255 ( memory_order __x__ ) volatile
3256 { return atomic_load_explicit( this, __x__ ); }
3258 inline int atomic_int::exchange
3259 ( int __m__, memory_order __x__ ) volatile
3260 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3262 inline bool atomic_int::compare_exchange_weak
3263 ( int& __e__, int __m__,
3264 memory_order __x__, memory_order __y__ ) volatile
3265 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3267 inline bool atomic_int::compare_exchange_strong
3268 ( int& __e__, int __m__,
3269 memory_order __x__, memory_order __y__ ) volatile
3270 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3272 inline bool atomic_int::compare_exchange_weak
3273 ( int& __e__, int __m__, memory_order __x__ ) volatile
3274 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3275 __x__ == memory_order_acq_rel ? memory_order_acquire :
3276 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3278 inline bool atomic_int::compare_exchange_strong
3279 ( int& __e__, int __m__, memory_order __x__ ) volatile
3280 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3281 __x__ == memory_order_acq_rel ? memory_order_acquire :
3282 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3285 inline bool atomic_uint::is_lock_free() const volatile
3288 inline void atomic_uint::store
3289 ( unsigned int __m__, memory_order __x__ ) volatile
3290 { atomic_store_explicit( this, __m__, __x__ ); }
3292 inline unsigned int atomic_uint::load
3293 ( memory_order __x__ ) volatile
3294 { return atomic_load_explicit( this, __x__ ); }
3296 inline unsigned int atomic_uint::exchange
3297 ( unsigned int __m__, memory_order __x__ ) volatile
3298 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3300 inline bool atomic_uint::compare_exchange_weak
3301 ( unsigned int& __e__, unsigned int __m__,
3302 memory_order __x__, memory_order __y__ ) volatile
3303 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3305 inline bool atomic_uint::compare_exchange_strong
3306 ( unsigned int& __e__, unsigned int __m__,
3307 memory_order __x__, memory_order __y__ ) volatile
3308 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3310 inline bool atomic_uint::compare_exchange_weak
3311 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
3312 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3313 __x__ == memory_order_acq_rel ? memory_order_acquire :
3314 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3316 inline bool atomic_uint::compare_exchange_strong
3317 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
3318 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3319 __x__ == memory_order_acq_rel ? memory_order_acquire :
3320 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3323 inline bool atomic_long::is_lock_free() const volatile
3326 inline void atomic_long::store
3327 ( long __m__, memory_order __x__ ) volatile
3328 { atomic_store_explicit( this, __m__, __x__ ); }
3330 inline long atomic_long::load
3331 ( memory_order __x__ ) volatile
3332 { return atomic_load_explicit( this, __x__ ); }
3334 inline long atomic_long::exchange
3335 ( long __m__, memory_order __x__ ) volatile
3336 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3338 inline bool atomic_long::compare_exchange_weak
3339 ( long& __e__, long __m__,
3340 memory_order __x__, memory_order __y__ ) volatile
3341 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3343 inline bool atomic_long::compare_exchange_strong
3344 ( long& __e__, long __m__,
3345 memory_order __x__, memory_order __y__ ) volatile
3346 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3348 inline bool atomic_long::compare_exchange_weak
3349 ( long& __e__, long __m__, memory_order __x__ ) volatile
3350 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3351 __x__ == memory_order_acq_rel ? memory_order_acquire :
3352 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3354 inline bool atomic_long::compare_exchange_strong
3355 ( long& __e__, long __m__, memory_order __x__ ) volatile
3356 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3357 __x__ == memory_order_acq_rel ? memory_order_acquire :
3358 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3361 inline bool atomic_ulong::is_lock_free() const volatile
3364 inline void atomic_ulong::store
3365 ( unsigned long __m__, memory_order __x__ ) volatile
3366 { atomic_store_explicit( this, __m__, __x__ ); }
3368 inline unsigned long atomic_ulong::load
3369 ( memory_order __x__ ) volatile
3370 { return atomic_load_explicit( this, __x__ ); }
3372 inline unsigned long atomic_ulong::exchange
3373 ( unsigned long __m__, memory_order __x__ ) volatile
3374 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3376 inline bool atomic_ulong::compare_exchange_weak
3377 ( unsigned long& __e__, unsigned long __m__,
3378 memory_order __x__, memory_order __y__ ) volatile
3379 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3381 inline bool atomic_ulong::compare_exchange_strong
3382 ( unsigned long& __e__, unsigned long __m__,
3383 memory_order __x__, memory_order __y__ ) volatile
3384 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3386 inline bool atomic_ulong::compare_exchange_weak
3387 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
3388 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3389 __x__ == memory_order_acq_rel ? memory_order_acquire :
3390 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3392 inline bool atomic_ulong::compare_exchange_strong
3393 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
3394 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3395 __x__ == memory_order_acq_rel ? memory_order_acquire :
3396 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3399 inline bool atomic_llong::is_lock_free() const volatile
3402 inline void atomic_llong::store
3403 ( long long __m__, memory_order __x__ ) volatile
3404 { atomic_store_explicit( this, __m__, __x__ ); }
3406 inline long long atomic_llong::load
3407 ( memory_order __x__ ) volatile
3408 { return atomic_load_explicit( this, __x__ ); }
3410 inline long long atomic_llong::exchange
3411 ( long long __m__, memory_order __x__ ) volatile
3412 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3414 inline bool atomic_llong::compare_exchange_weak
3415 ( long long& __e__, long long __m__,
3416 memory_order __x__, memory_order __y__ ) volatile
3417 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3419 inline bool atomic_llong::compare_exchange_strong
3420 ( long long& __e__, long long __m__,
3421 memory_order __x__, memory_order __y__ ) volatile
3422 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3424 inline bool atomic_llong::compare_exchange_weak
3425 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
3426 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3427 __x__ == memory_order_acq_rel ? memory_order_acquire :
3428 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3430 inline bool atomic_llong::compare_exchange_strong
3431 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
3432 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3433 __x__ == memory_order_acq_rel ? memory_order_acquire :
3434 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3437 inline bool atomic_ullong::is_lock_free() const volatile
3440 inline void atomic_ullong::store
3441 ( unsigned long long __m__, memory_order __x__ ) volatile
3442 { atomic_store_explicit( this, __m__, __x__ ); }
3444 inline unsigned long long atomic_ullong::load
3445 ( memory_order __x__ ) volatile
3446 { return atomic_load_explicit( this, __x__ ); }
3448 inline unsigned long long atomic_ullong::exchange
3449 ( unsigned long long __m__, memory_order __x__ ) volatile
3450 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3452 inline bool atomic_ullong::compare_exchange_weak
3453 ( unsigned long long& __e__, unsigned long long __m__,
3454 memory_order __x__, memory_order __y__ ) volatile
3455 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3457 inline bool atomic_ullong::compare_exchange_strong
3458 ( unsigned long long& __e__, unsigned long long __m__,
3459 memory_order __x__, memory_order __y__ ) volatile
3460 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3462 inline bool atomic_ullong::compare_exchange_weak
3463 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
3464 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3465 __x__ == memory_order_acq_rel ? memory_order_acquire :
3466 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3468 inline bool atomic_ullong::compare_exchange_strong
3469 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
3470 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3471 __x__ == memory_order_acq_rel ? memory_order_acquire :
3472 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3475 inline bool atomic_wchar_t::is_lock_free() const volatile
3478 inline void atomic_wchar_t::store
3479 ( wchar_t __m__, memory_order __x__ ) volatile
3480 { atomic_store_explicit( this, __m__, __x__ ); }
3482 inline wchar_t atomic_wchar_t::load
3483 ( memory_order __x__ ) volatile
3484 { return atomic_load_explicit( this, __x__ ); }
3486 inline wchar_t atomic_wchar_t::exchange
3487 ( wchar_t __m__, memory_order __x__ ) volatile
3488 { return atomic_exchange_explicit( this, __m__, __x__ ); }
3490 inline bool atomic_wchar_t::compare_exchange_weak
3491 ( wchar_t& __e__, wchar_t __m__,
3492 memory_order __x__, memory_order __y__ ) volatile
3493 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
3495 inline bool atomic_wchar_t::compare_exchange_strong
3496 ( wchar_t& __e__, wchar_t __m__,
3497 memory_order __x__, memory_order __y__ ) volatile
3498 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
3500 inline bool atomic_wchar_t::compare_exchange_weak
3501 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
3502 { return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
3503 __x__ == memory_order_acq_rel ? memory_order_acquire :
3504 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3506 inline bool atomic_wchar_t::compare_exchange_strong
3507 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
3508 { return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
3509 __x__ == memory_order_acq_rel ? memory_order_acquire :
3510 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3513 template< typename T >
3514 inline bool atomic<T>::is_lock_free() const volatile
3517 template< typename T >
3518 inline void atomic<T>::store( T __v__, memory_order __x__ ) volatile
3519 { _ATOMIC_STORE_( this, __v__, __x__ ); }
3521 template< typename T >
3522 inline T atomic<T>::load( memory_order __x__ ) volatile
3523 { return _ATOMIC_LOAD_( this, __x__ ); }
3525 template< typename T >
3526 inline T atomic<T>::exchange( T __v__, memory_order __x__ ) volatile
3527 { return _ATOMIC_MODIFY_( this, =, __v__, __x__ ); }
3529 template< typename T >
3530 inline bool atomic<T>::compare_exchange_weak
3531 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
3532 { return _ATOMIC_CMPSWP_WEAK_( this, &__r__, __v__, __x__ ); }
3534 template< typename T >
3535 inline bool atomic<T>::compare_exchange_strong
3536 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
3537 { return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
3539 template< typename T >
3540 inline bool atomic<T>::compare_exchange_weak
3541 ( T& __r__, T __v__, memory_order __x__ ) volatile
3542 { return compare_exchange_weak( __r__, __v__, __x__,
3543 __x__ == memory_order_acq_rel ? memory_order_acquire :
3544 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3546 template< typename T >
3547 inline bool atomic<T>::compare_exchange_strong
3548 ( T& __r__, T __v__, memory_order __x__ ) volatile
3549 { return compare_exchange_strong( __r__, __v__, __x__,
3550 __x__ == memory_order_acq_rel ? memory_order_acquire :
3551 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3554 inline void* atomic_address::fetch_add
3555 ( ptrdiff_t __m__, memory_order __x__ ) volatile
3556 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3558 inline void* atomic_address::fetch_sub
3559 ( ptrdiff_t __m__, memory_order __x__ ) volatile
3560 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3563 inline char atomic_char::fetch_add
3564 ( char __m__, memory_order __x__ ) volatile
3565 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3568 inline char atomic_char::fetch_sub
3569 ( char __m__, memory_order __x__ ) volatile
3570 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3573 inline char atomic_char::fetch_and
3574 ( char __m__, memory_order __x__ ) volatile
3575 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3578 inline char atomic_char::fetch_or
3579 ( char __m__, memory_order __x__ ) volatile
3580 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3583 inline char atomic_char::fetch_xor
3584 ( char __m__, memory_order __x__ ) volatile
3585 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3588 inline signed char atomic_schar::fetch_add
3589 ( signed char __m__, memory_order __x__ ) volatile
3590 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3593 inline signed char atomic_schar::fetch_sub
3594 ( signed char __m__, memory_order __x__ ) volatile
3595 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3598 inline signed char atomic_schar::fetch_and
3599 ( signed char __m__, memory_order __x__ ) volatile
3600 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3603 inline signed char atomic_schar::fetch_or
3604 ( signed char __m__, memory_order __x__ ) volatile
3605 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3608 inline signed char atomic_schar::fetch_xor
3609 ( signed char __m__, memory_order __x__ ) volatile
3610 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3613 inline unsigned char atomic_uchar::fetch_add
3614 ( unsigned char __m__, memory_order __x__ ) volatile
3615 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3618 inline unsigned char atomic_uchar::fetch_sub
3619 ( unsigned char __m__, memory_order __x__ ) volatile
3620 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3623 inline unsigned char atomic_uchar::fetch_and
3624 ( unsigned char __m__, memory_order __x__ ) volatile
3625 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3628 inline unsigned char atomic_uchar::fetch_or
3629 ( unsigned char __m__, memory_order __x__ ) volatile
3630 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3633 inline unsigned char atomic_uchar::fetch_xor
3634 ( unsigned char __m__, memory_order __x__ ) volatile
3635 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3638 inline short atomic_short::fetch_add
3639 ( short __m__, memory_order __x__ ) volatile
3640 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3643 inline short atomic_short::fetch_sub
3644 ( short __m__, memory_order __x__ ) volatile
3645 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3648 inline short atomic_short::fetch_and
3649 ( short __m__, memory_order __x__ ) volatile
3650 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3653 inline short atomic_short::fetch_or
3654 ( short __m__, memory_order __x__ ) volatile
3655 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3658 inline short atomic_short::fetch_xor
3659 ( short __m__, memory_order __x__ ) volatile
3660 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3663 inline unsigned short atomic_ushort::fetch_add
3664 ( unsigned short __m__, memory_order __x__ ) volatile
3665 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3668 inline unsigned short atomic_ushort::fetch_sub
3669 ( unsigned short __m__, memory_order __x__ ) volatile
3670 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3673 inline unsigned short atomic_ushort::fetch_and
3674 ( unsigned short __m__, memory_order __x__ ) volatile
3675 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3678 inline unsigned short atomic_ushort::fetch_or
3679 ( unsigned short __m__, memory_order __x__ ) volatile
3680 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3683 inline unsigned short atomic_ushort::fetch_xor
3684 ( unsigned short __m__, memory_order __x__ ) volatile
3685 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3688 inline int atomic_int::fetch_add
3689 ( int __m__, memory_order __x__ ) volatile
3690 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3693 inline int atomic_int::fetch_sub
3694 ( int __m__, memory_order __x__ ) volatile
3695 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3698 inline int atomic_int::fetch_and
3699 ( int __m__, memory_order __x__ ) volatile
3700 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3703 inline int atomic_int::fetch_or
3704 ( int __m__, memory_order __x__ ) volatile
3705 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3708 inline int atomic_int::fetch_xor
3709 ( int __m__, memory_order __x__ ) volatile
3710 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3713 inline unsigned int atomic_uint::fetch_add
3714 ( unsigned int __m__, memory_order __x__ ) volatile
3715 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3718 inline unsigned int atomic_uint::fetch_sub
3719 ( unsigned int __m__, memory_order __x__ ) volatile
3720 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3723 inline unsigned int atomic_uint::fetch_and
3724 ( unsigned int __m__, memory_order __x__ ) volatile
3725 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3728 inline unsigned int atomic_uint::fetch_or
3729 ( unsigned int __m__, memory_order __x__ ) volatile
3730 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3733 inline unsigned int atomic_uint::fetch_xor
3734 ( unsigned int __m__, memory_order __x__ ) volatile
3735 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3738 inline long atomic_long::fetch_add
3739 ( long __m__, memory_order __x__ ) volatile
3740 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3743 inline long atomic_long::fetch_sub
3744 ( long __m__, memory_order __x__ ) volatile
3745 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3748 inline long atomic_long::fetch_and
3749 ( long __m__, memory_order __x__ ) volatile
3750 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3753 inline long atomic_long::fetch_or
3754 ( long __m__, memory_order __x__ ) volatile
3755 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3758 inline long atomic_long::fetch_xor
3759 ( long __m__, memory_order __x__ ) volatile
3760 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3763 inline unsigned long atomic_ulong::fetch_add
3764 ( unsigned long __m__, memory_order __x__ ) volatile
3765 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3768 inline unsigned long atomic_ulong::fetch_sub
3769 ( unsigned long __m__, memory_order __x__ ) volatile
3770 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3773 inline unsigned long atomic_ulong::fetch_and
3774 ( unsigned long __m__, memory_order __x__ ) volatile
3775 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3778 inline unsigned long atomic_ulong::fetch_or
3779 ( unsigned long __m__, memory_order __x__ ) volatile
3780 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3783 inline unsigned long atomic_ulong::fetch_xor
3784 ( unsigned long __m__, memory_order __x__ ) volatile
3785 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3788 inline long long atomic_llong::fetch_add
3789 ( long long __m__, memory_order __x__ ) volatile
3790 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3793 inline long long atomic_llong::fetch_sub
3794 ( long long __m__, memory_order __x__ ) volatile
3795 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3798 inline long long atomic_llong::fetch_and
3799 ( long long __m__, memory_order __x__ ) volatile
3800 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3803 inline long long atomic_llong::fetch_or
3804 ( long long __m__, memory_order __x__ ) volatile
3805 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3808 inline long long atomic_llong::fetch_xor
3809 ( long long __m__, memory_order __x__ ) volatile
3810 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3813 inline unsigned long long atomic_ullong::fetch_add
3814 ( unsigned long long __m__, memory_order __x__ ) volatile
3815 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3818 inline unsigned long long atomic_ullong::fetch_sub
3819 ( unsigned long long __m__, memory_order __x__ ) volatile
3820 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3823 inline unsigned long long atomic_ullong::fetch_and
3824 ( unsigned long long __m__, memory_order __x__ ) volatile
3825 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3828 inline unsigned long long atomic_ullong::fetch_or
3829 ( unsigned long long __m__, memory_order __x__ ) volatile
3830 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3833 inline unsigned long long atomic_ullong::fetch_xor
3834 ( unsigned long long __m__, memory_order __x__ ) volatile
3835 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3838 inline wchar_t atomic_wchar_t::fetch_add
3839 ( wchar_t __m__, memory_order __x__ ) volatile
3840 { return atomic_fetch_add_explicit( this, __m__, __x__ ); }
3843 inline wchar_t atomic_wchar_t::fetch_sub
3844 ( wchar_t __m__, memory_order __x__ ) volatile
3845 { return atomic_fetch_sub_explicit( this, __m__, __x__ ); }
3848 inline wchar_t atomic_wchar_t::fetch_and
3849 ( wchar_t __m__, memory_order __x__ ) volatile
3850 { return atomic_fetch_and_explicit( this, __m__, __x__ ); }
3853 inline wchar_t atomic_wchar_t::fetch_or
3854 ( wchar_t __m__, memory_order __x__ ) volatile
3855 { return atomic_fetch_or_explicit( this, __m__, __x__ ); }
3858 inline wchar_t atomic_wchar_t::fetch_xor
3859 ( wchar_t __m__, memory_order __x__ ) volatile
3860 { return atomic_fetch_xor_explicit( this, __m__, __x__ ); }
3863 template< typename T >
3864 T* atomic<T*>::load( memory_order __x__ ) volatile
3865 { return static_cast<T*>( atomic_address::load( __x__ ) ); }
3867 template< typename T >
3868 T* atomic<T*>::exchange( T* __v__, memory_order __x__ ) volatile
3869 { return static_cast<T*>( atomic_address::exchange( __v__, __x__ ) ); }
3871 template< typename T >
3872 bool atomic<T*>::compare_exchange_weak
3873 ( T*& __r__, T* __v__, memory_order __x__, memory_order __y__) volatile
3874 { return atomic_address::compare_exchange_weak( *reinterpret_cast<void**>( &__r__ ),
3875 static_cast<void*>( __v__ ), __x__, __y__ ); }
3876 //{ return _ATOMIC_CMPSWP_WEAK_( this, &__r__, __v__, __x__ ); }
3878 template< typename T >
3879 bool atomic<T*>::compare_exchange_strong
3880 ( T*& __r__, T* __v__, memory_order __x__, memory_order __y__) volatile
3881 { return atomic_address::compare_exchange_strong( *reinterpret_cast<void**>( &__r__ ),
3882 static_cast<void*>( __v__ ), __x__, __y__ ); }
3883 //{ return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
3885 template< typename T >
3886 bool atomic<T*>::compare_exchange_weak
3887 ( T*& __r__, T* __v__, memory_order __x__ ) volatile
3888 { return compare_exchange_weak( __r__, __v__, __x__,
3889 __x__ == memory_order_acq_rel ? memory_order_acquire :
3890 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3892 template< typename T >
3893 bool atomic<T*>::compare_exchange_strong
3894 ( T*& __r__, T* __v__, memory_order __x__ ) volatile
3895 { return compare_exchange_strong( __r__, __v__, __x__,
3896 __x__ == memory_order_acq_rel ? memory_order_acquire :
3897 __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
3899 template< typename T >
3900 T* atomic<T*>::fetch_add( ptrdiff_t __v__, memory_order __x__ ) volatile
3901 { return atomic_fetch_add_explicit( this, sizeof(T) * __v__, __x__ ); }
3903 template< typename T >
3904 T* atomic<T*>::fetch_sub( ptrdiff_t __v__, memory_order __x__ ) volatile
3905 { return atomic_fetch_sub_explicit( this, sizeof(T) * __v__, __x__ ); }
3913 static inline void atomic_thread_fence(memory_order order)
3914 { _ATOMIC_FENCE_(order); }
3916 /** @todo Do we want to try to support a user's signal-handler? */
3917 static inline void atomic_signal_fence(memory_order order)
3928 #endif /* __IMPATOMIC_H__ */