Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- atomic -----------------------------------===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_ATOMIC |
| 12 | #define _LIBCPP_ATOMIC |
| 13 | |
| 14 | /* |
| 15 | atomic synopsis |
| 16 | |
| 17 | namespace std |
| 18 | { |
| 19 | |
| 20 | // order and consistency |
| 21 | |
| 22 | typedef enum memory_order |
| 23 | { |
Howard Hinnant | d1176e2 | 2010-09-28 17:13:38 +0000 | [diff] [blame] | 24 | memory_order_relaxed, |
| 25 | memory_order_consume, // load-consume |
| 26 | memory_order_acquire, // load-acquire |
| 27 | memory_order_release, // store-release |
| 28 | memory_order_acq_rel, // store-release load-acquire |
| 29 | memory_order_seq_cst // store-release load-acquire |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 30 | } memory_order; |
| 31 | |
| 32 | template <class T> T kill_dependency(T y); |
| 33 | |
| 34 | // lock-free property |
| 35 | |
| 36 | #define ATOMIC_CHAR_LOCK_FREE unspecified |
| 37 | #define ATOMIC_CHAR16_T_LOCK_FREE unspecified |
| 38 | #define ATOMIC_CHAR32_T_LOCK_FREE unspecified |
| 39 | #define ATOMIC_WCHAR_T_LOCK_FREE unspecified |
| 40 | #define ATOMIC_SHORT_LOCK_FREE unspecified |
| 41 | #define ATOMIC_INT_LOCK_FREE unspecified |
| 42 | #define ATOMIC_LONG_LOCK_FREE unspecified |
| 43 | #define ATOMIC_LLONG_LOCK_FREE unspecified |
| 44 | #define ATOMIC_ADDRESS_LOCK_FREE unspecified |
| 45 | |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 46 | // flag type and operations |
| 47 | |
| 48 | typedef struct atomic_flag |
| 49 | { |
| 50 | bool test_and_set(memory_order = memory_order_seq_cst) volatile; |
| 51 | bool test_and_set(memory_order = memory_order_seq_cst); |
| 52 | void clear(memory_order = memory_order_seq_cst) volatile; |
| 53 | void clear(memory_order = memory_order_seq_cst); |
| 54 | atomic_flag() = default; |
| 55 | atomic_flag(const atomic_flag&) = delete; |
| 56 | atomic_flag& operator=(const atomic_flag&) = delete; |
| 57 | atomic_flag& operator=(const atomic_flag&) volatile = delete; |
| 58 | } atomic_flag; |
| 59 | |
| 60 | bool atomic_flag_test_and_set(volatile atomic_flag*); |
| 61 | bool atomic_flag_test_and_set(atomic_flag*); |
| 62 | bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order); |
| 63 | bool atomic_flag_test_and_set_explicit(atomic_flag*, memory_order); |
| 64 | void atomic_flag_clear(volatile atomic_flag*); |
| 65 | void atomic_flag_clear(atomic_flag*); |
| 66 | void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order); |
| 67 | void atomic_flag_clear_explicit(atomic_flag*, memory_order); |
| 68 | |
| 69 | #define ATOMIC_FLAG_INIT see below |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 70 | #define ATOMIC_VAR_INIT(value) see below |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 71 | |
| 72 | // atomic_bool |
| 73 | |
| 74 | typedef struct atomic_bool |
| 75 | { |
| 76 | bool is_lock_free() const volatile; |
| 77 | bool is_lock_free() const; |
| 78 | void store(bool, memory_order = memory_order_seq_cst) volatile; |
| 79 | void store(bool, memory_order = memory_order_seq_cst); |
| 80 | bool load(memory_order = memory_order_seq_cst) const volatile; |
| 81 | bool load(memory_order = memory_order_seq_cst) const; |
| 82 | operator bool() const volatile; |
| 83 | operator bool() const; |
| 84 | bool exchange(bool, memory_order = memory_order_seq_cst) volatile; |
| 85 | bool exchange(bool, memory_order = memory_order_seq_cst); |
| 86 | bool compare_exchange_weak(bool&, bool, memory_order, |
| 87 | memory_order) volatile; |
| 88 | bool compare_exchange_weak(bool&, bool, memory_order, memory_order); |
| 89 | bool compare_exchange_strong(bool&, bool, memory_order, |
| 90 | memory_order) volatile; |
| 91 | bool compare_exchange_strong(bool&, bool, memory_order, memory_order); |
| 92 | bool compare_exchange_weak(bool&, bool, |
| 93 | memory_order = memory_order_seq_cst) volatile; |
| 94 | bool compare_exchange_weak(bool&, bool, |
| 95 | memory_order = memory_order_seq_cst); |
| 96 | bool compare_exchange_strong(bool&, bool, |
| 97 | memory_order = memory_order_seq_cst) volatile; |
| 98 | bool compare_exchange_strong(bool&, bool, |
| 99 | memory_order = memory_order_seq_cst); |
| 100 | atomic_bool() = default; |
| 101 | constexpr atomic_bool(bool); |
| 102 | atomic_bool(const atomic_bool&) = delete; |
| 103 | atomic_bool& operator=(const atomic_bool&) = delete; |
| 104 | atomic_bool& operator=(const atomic_bool&) volatile = delete; |
| 105 | bool operator=(bool) volatile; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 106 | bool operator=(bool); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 107 | } atomic_bool; |
| 108 | |
| 109 | bool atomic_is_lock_free(const volatile atomic_bool*); |
| 110 | bool atomic_is_lock_free(const atomic_bool*); |
| 111 | void atomic_init(volatile atomic_bool*, bool); |
| 112 | void atomic_init(atomic_bool*, bool); |
| 113 | void atomic_store(volatile atomic_bool*, bool); |
| 114 | void atomic_store(atomic_bool*, bool); |
| 115 | void atomic_store_explicit(volatile atomic_bool*, bool, memory_order); |
| 116 | void atomic_store_explicit(atomic_bool*, bool, memory_order); |
| 117 | bool atomic_load(const volatile atomic_bool*); |
| 118 | bool atomic_load(const atomic_bool*); |
| 119 | bool atomic_load_explicit(const volatile atomic_bool*, memory_order); |
| 120 | bool atomic_load_explicit(const atomic_bool*, memory_order); |
| 121 | bool atomic_exchange(volatile atomic_bool*, bool); |
| 122 | bool atomic_exchange(atomic_bool*, bool); |
| 123 | bool atomic_exchange_explicit(volatile atomic_bool*, bool, memory_order); |
| 124 | bool atomic_exchange_explicit(atomic_bool*, bool, memory_order); |
| 125 | bool atomic_compare_exchange_weak(volatile atomic_bool*, bool*, bool); |
| 126 | bool atomic_compare_exchange_weak(atomic_bool*, bool*, bool); |
| 127 | bool atomic_compare_exchange_strong(volatile atomic_bool*, bool*, bool); |
| 128 | bool atomic_compare_exchange_strong(atomic_bool*, bool*, bool); |
| 129 | bool atomic_compare_exchange_weak_explicit(volatile atomic_bool*, bool*, bool, |
| 130 | memory_order, memory_order); |
| 131 | bool atomic_compare_exchange_weak_explicit(atomic_bool*, bool*, bool, |
| 132 | memory_order, memory_order); |
| 133 | bool atomic_compare_exchange_strong_explicit(volatile atomic_bool*, bool*, bool, |
| 134 | memory_order, memory_order); |
| 135 | bool atomic_compare_exchange_strong_explicit(atomic_bool*, bool*, bool, |
| 136 | memory_order, memory_order); |
| 137 | |
| 138 | // atomic_char |
| 139 | |
| 140 | typedef struct atomic_char |
| 141 | { |
| 142 | bool is_lock_free() const volatile; |
| 143 | bool is_lock_free() const; |
| 144 | void store(char, memory_order = memory_order_seq_cst) volatile; |
| 145 | void store(char, memory_order = memory_order_seq_cst); |
| 146 | char load(memory_order = memory_order_seq_cst) const volatile; |
| 147 | char load(memory_order = memory_order_seq_cst) const; |
| 148 | operator char() const volatile; |
| 149 | operator char() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 150 | char exchange(char, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 151 | char exchange(char, memory_order = memory_order_seq_cst); |
| 152 | bool compare_exchange_weak(char&, char, memory_order, |
| 153 | memory_order) volatile; |
| 154 | bool compare_exchange_weak(char&, char, memory_order, memory_order); |
| 155 | bool compare_exchange_strong(char&, char, memory_order, |
| 156 | memory_order) volatile; |
| 157 | bool compare_exchange_strong(char&, char, memory_order, memory_order); |
| 158 | bool compare_exchange_weak(char&, char, |
| 159 | memory_order = memory_order_seq_cst) volatile; |
| 160 | bool compare_exchange_weak(char&, char, |
| 161 | memory_order = memory_order_seq_cst); |
| 162 | bool compare_exchange_strong(char&, char, |
| 163 | memory_order = memory_order_seq_cst) volatile; |
| 164 | bool compare_exchange_strong(char&, char, |
| 165 | memory_order = memory_order_seq_cst); |
| 166 | char fetch_add(char, memory_order = memory_order_seq_cst) volatile; |
| 167 | char fetch_add(char, memory_order = memory_order_seq_cst); |
| 168 | char fetch_sub(char, memory_order = memory_order_seq_cst) volatile; |
| 169 | char fetch_sub(char, memory_order = memory_order_seq_cst); |
| 170 | char fetch_and(char, memory_order = memory_order_seq_cst) volatile; |
| 171 | char fetch_and(char, memory_order = memory_order_seq_cst); |
| 172 | char fetch_or(char, memory_order = memory_order_seq_cst) volatile; |
| 173 | char fetch_or(char, memory_order = memory_order_seq_cst); |
| 174 | char fetch_xor(char, memory_order = memory_order_seq_cst) volatile; |
| 175 | char fetch_xor(char, memory_order = memory_order_seq_cst); |
| 176 | atomic_char() = default; |
| 177 | constexpr atomic_char(char); |
| 178 | atomic_char(const atomic_char&) = delete; |
| 179 | atomic_char& operator=(const atomic_char&) = delete; |
| 180 | atomic_char& operator=(const atomic_char&) volatile = delete; |
| 181 | char operator=(char) volatile; |
| 182 | char operator=(char); |
| 183 | char operator++(int) volatile; |
| 184 | char operator++(int); |
| 185 | char operator--(int) volatile; |
| 186 | char operator--(int); |
| 187 | char operator++() volatile; |
| 188 | char operator++(); |
| 189 | char operator--() volatile; |
| 190 | char operator--(); |
| 191 | char operator+=(char) volatile; |
| 192 | char operator+=(char); |
| 193 | char operator-=(char) volatile; |
| 194 | char operator-=(char); |
| 195 | char operator&=(char) volatile; |
| 196 | char operator&=(char); |
| 197 | char operator|=(char) volatile; |
| 198 | char operator|=(char); |
| 199 | char operator^=(char) volatile; |
| 200 | char operator^=(char); |
| 201 | } atomic_char; |
| 202 | |
| 203 | bool atomic_is_lock_free(const volatile atomic_char*); |
| 204 | bool atomic_is_lock_free(const atomic_char*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 205 | void atomic_init(volatile atomic_char*, char); |
| 206 | void atomic_init(atomic_char*, char); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 207 | void atomic_store(volatile atomic_char*, char); |
| 208 | void atomic_store(atomic_char*, char); |
| 209 | void atomic_store_explicit(volatile atomic_char*, char, memory_order); |
| 210 | void atomic_store_explicit(atomic_char*, char, memory_order); |
| 211 | char atomic_load(const volatile atomic_char*); |
| 212 | char atomic_load(const atomic_char*); |
| 213 | char atomic_load_explicit(const volatile atomic_char*, memory_order); |
| 214 | char atomic_load_explicit(const atomic_char*, memory_order); |
| 215 | char atomic_exchange(volatile atomic_char*, char); |
| 216 | char atomic_exchange(atomic_char*, char); |
| 217 | char atomic_exchange_explicit(volatile atomic_char*, char, memory_order); |
| 218 | char atomic_exchange_explicit(atomic_char*, char, memory_order); |
| 219 | bool atomic_compare_exchange_weak(volatile atomic_char*, char*, char); |
| 220 | bool atomic_compare_exchange_weak(atomic_char*, char*, char); |
| 221 | bool atomic_compare_exchange_strong(volatile atomic_char*, char*, char); |
| 222 | bool atomic_compare_exchange_strong(atomic_char*, char*, char); |
| 223 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char*, char*, char, |
| 224 | memory_order, memory_order); |
| 225 | bool atomic_compare_exchange_weak_explicit(atomic_char*, char*, char, |
| 226 | memory_order, memory_order); |
| 227 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char*, char*, char, |
| 228 | memory_order, memory_order); |
| 229 | bool atomic_compare_exchange_strong_explicit(atomic_char*, char*, char, |
| 230 | memory_order, memory_order); |
| 231 | char atomic_fetch_add(volatile atomic_char*, char); |
| 232 | char atomic_fetch_add(atomic_char*, char); |
| 233 | char atomic_fetch_add_explicit(volatile atomic_char*, char, memory_order); |
| 234 | char atomic_fetch_add_explicit(atomic_char*, char, memory_order); |
| 235 | char atomic_fetch_sub(volatile atomic_char*, char); |
| 236 | char atomic_fetch_sub(atomic_char*, char); |
| 237 | char atomic_fetch_sub_explicit(volatile atomic_char*, char, memory_order); |
| 238 | char atomic_fetch_sub_explicit(atomic_char*, char, memory_order); |
| 239 | char atomic_fetch_and(volatile atomic_char*, char); |
| 240 | char atomic_fetch_and(atomic_char*, char); |
| 241 | char atomic_fetch_and_explicit(volatile atomic_char*, char, memory_order); |
| 242 | char atomic_fetch_and_explicit(atomic_char*, char, memory_order); |
| 243 | char atomic_fetch_or(volatile atomic_char*, char); |
| 244 | char atomic_fetch_or(atomic_char*, char); |
| 245 | char atomic_fetch_or_explicit(volatile atomic_char*, char, memory_order); |
| 246 | char atomic_fetch_or_explicit(atomic_char*, char, memory_order); |
| 247 | char atomic_fetch_xor(volatile atomic_char*, char); |
| 248 | char atomic_fetch_xor(atomic_char*, char); |
| 249 | char atomic_fetch_xor_explicit(volatile atomic_char*, char, memory_order); |
| 250 | char atomic_fetch_xor_explicit(atomic_char*, char, memory_order); |
| 251 | |
| 252 | // atomic_schar |
| 253 | |
| 254 | typedef struct atomic_schar |
| 255 | { |
| 256 | bool is_lock_free() const volatile; |
| 257 | bool is_lock_free() const; |
| 258 | void store(signed char, memory_order = memory_order_seq_cst) volatile; |
| 259 | void store(signed char, memory_order = memory_order_seq_cst); |
| 260 | signed char load(memory_order = memory_order_seq_cst) const volatile; |
| 261 | signed char load(memory_order = memory_order_seq_cst) const; |
| 262 | operator signed char() const volatile; |
| 263 | operator signed char() const; |
| 264 | signed char exchange(signed char, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 265 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 266 | signed char exchange(signed char, memory_order = memory_order_seq_cst); |
| 267 | bool compare_exchange_weak(signed char&, signed char, memory_order, |
| 268 | memory_order) volatile; |
| 269 | bool compare_exchange_weak(signed char&, signed char, memory_order, |
| 270 | memory_order); |
| 271 | bool compare_exchange_strong(signed char&, signed char, memory_order, |
| 272 | memory_order) volatile; |
| 273 | bool compare_exchange_strong(signed char&, signed char, memory_order, |
| 274 | memory_order); |
| 275 | bool compare_exchange_weak(signed char&, signed char, |
| 276 | memory_order = memory_order_seq_cst) volatile; |
| 277 | bool compare_exchange_weak(signed char&, signed char, |
| 278 | memory_order = memory_order_seq_cst); |
| 279 | bool compare_exchange_strong(signed char&, signed char, |
| 280 | memory_order = memory_order_seq_cst) volatile; |
| 281 | bool compare_exchange_strong(signed char&, signed char, |
| 282 | memory_order = memory_order_seq_cst); |
| 283 | signed char fetch_add(signed char, |
| 284 | memory_order = memory_order_seq_cst) volatile; |
| 285 | signed char fetch_add(signed char, memory_order = memory_order_seq_cst); |
| 286 | signed char fetch_sub(signed char, |
| 287 | memory_order = memory_order_seq_cst) volatile; |
| 288 | signed char fetch_sub(signed char, memory_order = memory_order_seq_cst); |
| 289 | signed char fetch_and(signed char, |
| 290 | memory_order = memory_order_seq_cst) volatile; |
| 291 | signed char fetch_and(signed char, memory_order = memory_order_seq_cst); |
| 292 | signed char fetch_or(signed char, |
| 293 | memory_order = memory_order_seq_cst) volatile; |
| 294 | signed char fetch_or(signed char, memory_order = memory_order_seq_cst); |
| 295 | signed char fetch_xor(signed char, |
| 296 | memory_order = memory_order_seq_cst) volatile; |
| 297 | signed char fetch_xor(signed char, memory_order = memory_order_seq_cst); |
| 298 | atomic_schar() = default; |
| 299 | constexpr atomic_schar(signed char); |
| 300 | atomic_schar(const atomic_schar&) = delete; |
| 301 | atomic_schar& operator=(const atomic_schar&) = delete; |
| 302 | atomic_schar& operator=(const atomic_schar&) volatile = delete; |
| 303 | signed char operator=(signed char) volatile; |
| 304 | signed char operator=(signed char); |
| 305 | signed char operator++(int) volatile; |
| 306 | signed char operator++(int); |
| 307 | signed char operator--(int) volatile; |
| 308 | signed char operator--(int); |
| 309 | signed char operator++() volatile; |
| 310 | signed char operator++(); |
| 311 | signed char operator--() volatile; |
| 312 | signed char operator--(); |
| 313 | signed char operator+=(signed char) volatile; |
| 314 | signed char operator+=(signed char); |
| 315 | signed char operator-=(signed char) volatile; |
| 316 | signed char operator-=(signed char); |
| 317 | signed char operator&=(signed char) volatile; |
| 318 | signed char operator&=(signed char); |
| 319 | signed char operator|=(signed char) volatile; |
| 320 | signed char operator|=(signed char); |
| 321 | signed char operator^=(signed char) volatile; |
| 322 | signed char operator^=(signed char); |
| 323 | } atomic_schar; |
| 324 | |
| 325 | bool atomic_is_lock_free(const volatile atomic_schar*); |
| 326 | bool atomic_is_lock_free(const atomic_schar*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 327 | void atomic_init(volatile atomic_schar*, signed char); |
| 328 | void atomic_init(atomic_schar*, signed char); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 329 | void atomic_store(volatile atomic_schar*, signed char); |
| 330 | void atomic_store(atomic_schar*, signed char); |
| 331 | void atomic_store_explicit(volatile atomic_schar*, signed char, memory_order); |
| 332 | void atomic_store_explicit(atomic_schar*, signed char, memory_order); |
| 333 | signed char atomic_load(const volatile atomic_schar*); |
| 334 | signed char atomic_load(const atomic_schar*); |
| 335 | signed char atomic_load_explicit(const volatile atomic_schar*, memory_order); |
| 336 | signed char atomic_load_explicit(const atomic_schar*, memory_order); |
| 337 | signed char atomic_exchange(volatile atomic_schar*, signed char); |
| 338 | signed char atomic_exchange(atomic_schar*, signed char); |
| 339 | signed char atomic_exchange_explicit(volatile atomic_schar*, signed char, |
| 340 | memory_order); |
| 341 | signed char atomic_exchange_explicit(atomic_schar*, signed char, memory_order); |
| 342 | bool atomic_compare_exchange_weak(volatile atomic_schar*, signed char*, |
| 343 | signed char); |
| 344 | bool atomic_compare_exchange_weak(atomic_schar*, signed char*, signed char); |
| 345 | bool atomic_compare_exchange_strong(volatile atomic_schar*, signed char*, |
| 346 | signed char); |
| 347 | bool atomic_compare_exchange_strong(atomic_schar*, signed char*, signed char); |
| 348 | bool atomic_compare_exchange_weak_explicit(volatile atomic_schar*, signed char*, |
| 349 | signed char, memory_order, |
| 350 | memory_order); |
| 351 | bool atomic_compare_exchange_weak_explicit(atomic_schar*, signed char*, |
| 352 | signed char, memory_order, |
| 353 | memory_order); |
| 354 | bool atomic_compare_exchange_strong_explicit(volatile atomic_schar*, |
| 355 | signed char*, signed char, |
| 356 | memory_order, memory_order); |
| 357 | bool atomic_compare_exchange_strong_explicit(atomic_schar*, signed char*, |
| 358 | signed char, memory_order, memory_order); |
| 359 | signed char atomic_fetch_add(volatile atomic_schar*, signed char); |
| 360 | signed char atomic_fetch_add(atomic_schar*, signed char); |
| 361 | signed char atomic_fetch_add_explicit(volatile atomic_schar*, signed char, |
| 362 | memory_order); |
| 363 | signed char atomic_fetch_add_explicit(atomic_schar*, signed char, memory_order); |
| 364 | signed char atomic_fetch_sub(volatile atomic_schar*, signed char); |
| 365 | signed char atomic_fetch_sub(atomic_schar*, signed char); |
| 366 | signed char atomic_fetch_sub_explicit(volatile atomic_schar*, signed char, |
| 367 | memory_order); |
| 368 | signed char atomic_fetch_sub_explicit(atomic_schar*, signed char, memory_order); |
| 369 | signed char atomic_fetch_and(volatile atomic_schar*, signed char); |
| 370 | signed char atomic_fetch_and(atomic_schar*, signed char); |
| 371 | signed char atomic_fetch_and_explicit(volatile atomic_schar*, signed char, |
| 372 | memory_order); |
| 373 | signed char atomic_fetch_and_explicit(atomic_schar*, signed char, memory_order); |
| 374 | signed char atomic_fetch_or(volatile atomic_schar*, signed char); |
| 375 | signed char atomic_fetch_or(atomic_schar*, signed char); |
| 376 | signed char atomic_fetch_or_explicit(volatile atomic_schar*, signed char, |
| 377 | memory_order); |
| 378 | signed char atomic_fetch_or_explicit(atomic_schar*, signed char, memory_order); |
| 379 | signed char atomic_fetch_xor(volatile atomic_schar*, signed char); |
| 380 | signed char atomic_fetch_xor(atomic_schar*, signed char); |
| 381 | signed char atomic_fetch_xor_explicit(volatile atomic_schar*, signed char, |
| 382 | memory_order); |
| 383 | signed char atomic_fetch_xor_explicit(atomic_schar*, signed char, memory_order); |
| 384 | |
| 385 | // atomic_uchar |
| 386 | |
| 387 | typedef struct atomic_uchar |
| 388 | { |
| 389 | bool is_lock_free() const volatile; |
| 390 | bool is_lock_free() const; |
| 391 | void store(unsigned char, memory_order = memory_order_seq_cst) volatile; |
| 392 | void store(unsigned char, memory_order = memory_order_seq_cst); |
| 393 | unsigned char load(memory_order = memory_order_seq_cst) const volatile; |
| 394 | unsigned char load(memory_order = memory_order_seq_cst) const; |
| 395 | operator unsigned char() const volatile; |
| 396 | operator unsigned char() const; |
| 397 | unsigned char exchange(unsigned char, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 398 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 399 | unsigned char exchange(unsigned char, memory_order = memory_order_seq_cst); |
| 400 | bool compare_exchange_weak(unsigned char&, unsigned char, memory_order, |
| 401 | memory_order) volatile; |
| 402 | bool compare_exchange_weak(unsigned char&, unsigned char, memory_order, |
| 403 | memory_order); |
| 404 | bool compare_exchange_strong(unsigned char&, unsigned char, memory_order, |
| 405 | memory_order) volatile; |
| 406 | bool compare_exchange_strong(unsigned char&, unsigned char, memory_order, |
| 407 | memory_order); |
| 408 | bool compare_exchange_weak(unsigned char&, unsigned char, |
| 409 | memory_order = memory_order_seq_cst) volatile; |
| 410 | bool compare_exchange_weak(unsigned char&, unsigned char, |
| 411 | memory_order = memory_order_seq_cst); |
| 412 | bool compare_exchange_strong(unsigned char&, unsigned char, |
| 413 | memory_order = memory_order_seq_cst) volatile; |
| 414 | bool compare_exchange_strong(unsigned char&, unsigned char, |
| 415 | memory_order = memory_order_seq_cst); |
| 416 | unsigned char fetch_add(unsigned char, |
| 417 | memory_order = memory_order_seq_cst) volatile; |
| 418 | unsigned char fetch_add(unsigned char, memory_order = memory_order_seq_cst); |
| 419 | unsigned char fetch_sub(unsigned char, |
| 420 | memory_order = memory_order_seq_cst) volatile; |
| 421 | unsigned char fetch_sub(unsigned char, memory_order = memory_order_seq_cst); |
| 422 | unsigned char fetch_and(unsigned char, |
| 423 | memory_order = memory_order_seq_cst) volatile; |
| 424 | unsigned char fetch_and(unsigned char, memory_order = memory_order_seq_cst); |
| 425 | unsigned char fetch_or(unsigned char, |
| 426 | memory_order = memory_order_seq_cst) volatile; |
| 427 | unsigned char fetch_or(unsigned char, memory_order = memory_order_seq_cst); |
| 428 | unsigned char fetch_xor(unsigned char, |
| 429 | memory_order = memory_order_seq_cst) volatile; |
| 430 | unsigned char fetch_xor(unsigned char, memory_order = memory_order_seq_cst); |
| 431 | atomic_uchar() = default; |
| 432 | constexpr atomic_uchar(unsigned char); |
| 433 | atomic_uchar(const atomic_uchar&) = delete; |
| 434 | atomic_uchar& operator=(const atomic_uchar&) = delete; |
| 435 | atomic_uchar& operator=(const atomic_uchar&) volatile = delete; |
| 436 | unsigned char operator=(unsigned char) volatile; |
| 437 | unsigned char operator=(unsigned char); |
| 438 | unsigned char operator++(int) volatile; |
| 439 | unsigned char operator++(int); |
| 440 | unsigned char operator--(int) volatile; |
| 441 | unsigned char operator--(int); |
| 442 | unsigned char operator++() volatile; |
| 443 | unsigned char operator++(); |
| 444 | unsigned char operator--() volatile; |
| 445 | unsigned char operator--(); |
| 446 | unsigned char operator+=(unsigned char) volatile; |
| 447 | unsigned char operator+=(unsigned char); |
| 448 | unsigned char operator-=(unsigned char) volatile; |
| 449 | unsigned char operator-=(unsigned char); |
| 450 | unsigned char operator&=(unsigned char) volatile; |
| 451 | unsigned char operator&=(unsigned char); |
| 452 | unsigned char operator|=(unsigned char) volatile; |
| 453 | unsigned char operator|=(unsigned char); |
| 454 | unsigned char operator^=(unsigned char) volatile; |
| 455 | unsigned char operator^=(unsigned char); |
| 456 | } atomic_uchar; |
| 457 | |
| 458 | bool atomic_is_lock_free(const volatile atomic_uchar*); |
| 459 | bool atomic_is_lock_free(const atomic_uchar*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 460 | void atomic_init(volatile atomic_uchar*, unsigned char); |
| 461 | void atomic_init(atomic_uchar*, unsigned char); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 462 | void atomic_store(volatile atomic_uchar*, unsigned char); |
| 463 | void atomic_store(atomic_uchar*, unsigned char); |
| 464 | void atomic_store_explicit(volatile atomic_uchar*, unsigned char, memory_order); |
| 465 | void atomic_store_explicit(atomic_uchar*, unsigned char, memory_order); |
| 466 | unsigned char atomic_load(const volatile atomic_uchar*); |
| 467 | unsigned char atomic_load(const atomic_uchar*); |
| 468 | unsigned char atomic_load_explicit(const volatile atomic_uchar*, memory_order); |
| 469 | unsigned char atomic_load_explicit(const atomic_uchar*, memory_order); |
| 470 | unsigned char atomic_exchange(volatile atomic_uchar*, unsigned char); |
| 471 | unsigned char atomic_exchange(atomic_uchar*, unsigned char); |
| 472 | unsigned char atomic_exchange_explicit(volatile atomic_uchar*, unsigned char, |
| 473 | memory_order); |
| 474 | unsigned char atomic_exchange_explicit(atomic_uchar*, unsigned char, |
| 475 | memory_order); |
| 476 | bool atomic_compare_exchange_weak(volatile atomic_uchar*, unsigned char*, |
| 477 | unsigned char); |
| 478 | bool atomic_compare_exchange_weak(atomic_uchar*, unsigned char*, unsigned char); |
| 479 | bool atomic_compare_exchange_strong(volatile atomic_uchar*, unsigned char*, |
| 480 | unsigned char); |
| 481 | bool atomic_compare_exchange_strong(atomic_uchar*, unsigned char*, |
| 482 | unsigned char); |
| 483 | bool atomic_compare_exchange_weak_explicit(volatile atomic_uchar*, |
| 484 | unsigned char*, unsigned char, |
| 485 | memory_order, memory_order); |
| 486 | bool atomic_compare_exchange_weak_explicit(atomic_uchar*, unsigned char*, |
| 487 | unsigned char, memory_order, |
| 488 | memory_order); |
| 489 | bool atomic_compare_exchange_strong_explicit(volatile atomic_uchar*, |
| 490 | unsigned char*, unsigned char, |
| 491 | memory_order, memory_order); |
| 492 | bool atomic_compare_exchange_strong_explicit(atomic_uchar*, unsigned char*, |
| 493 | unsigned char, memory_order, |
| 494 | memory_order); |
| 495 | unsigned char atomic_fetch_add(volatile atomic_uchar*, unsigned char); |
| 496 | unsigned char atomic_fetch_add(atomic_uchar*, unsigned char); |
| 497 | unsigned char atomic_fetch_add_explicit(volatile atomic_uchar*, unsigned char, |
| 498 | memory_order); |
| 499 | unsigned char atomic_fetch_add_explicit(atomic_uchar*, unsigned char, |
| 500 | memory_order); |
| 501 | unsigned char atomic_fetch_sub(volatile atomic_uchar*, unsigned char); |
| 502 | unsigned char atomic_fetch_sub(atomic_uchar*, unsigned char); |
| 503 | unsigned char atomic_fetch_sub_explicit(volatile atomic_uchar*, unsigned char, |
| 504 | memory_order); |
| 505 | unsigned char atomic_fetch_sub_explicit(atomic_uchar*, unsigned char, |
| 506 | memory_order); |
| 507 | unsigned char atomic_fetch_and(volatile atomic_uchar*, unsigned char); |
| 508 | unsigned char atomic_fetch_and(atomic_uchar*, unsigned char); |
| 509 | unsigned char atomic_fetch_and_explicit(volatile atomic_uchar*, unsigned char, |
| 510 | memory_order); |
| 511 | unsigned char atomic_fetch_and_explicit(atomic_uchar*, unsigned char, |
| 512 | memory_order); |
| 513 | unsigned char atomic_fetch_or(volatile atomic_uchar*, unsigned char); |
| 514 | unsigned char atomic_fetch_or(atomic_uchar*, unsigned char); |
| 515 | unsigned char atomic_fetch_or_explicit(volatile atomic_uchar*, unsigned char, |
| 516 | memory_order); |
| 517 | unsigned char atomic_fetch_or_explicit(atomic_uchar*, unsigned char, |
| 518 | memory_order); |
| 519 | unsigned char atomic_fetch_xor(volatile atomic_uchar*, unsigned char); |
| 520 | unsigned char atomic_fetch_xor(atomic_uchar*, unsigned char); |
| 521 | unsigned char atomic_fetch_xor_explicit(volatile atomic_uchar*, unsigned char, |
| 522 | memory_order); |
| 523 | unsigned char atomic_fetch_xor_explicit(atomic_uchar*, unsigned char, |
| 524 | memory_order); |
| 525 | |
| 526 | // atomic_short |
| 527 | |
| 528 | typedef struct atomic_short |
| 529 | { |
| 530 | bool is_lock_free() const volatile; |
| 531 | bool is_lock_free() const; |
| 532 | void store(short, memory_order = memory_order_seq_cst) volatile; |
| 533 | void store(short, memory_order = memory_order_seq_cst); |
| 534 | short load(memory_order = memory_order_seq_cst) const volatile; |
| 535 | short load(memory_order = memory_order_seq_cst) const; |
| 536 | operator short() const volatile; |
| 537 | operator short() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 538 | short exchange(short, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 539 | short exchange(short, memory_order = memory_order_seq_cst); |
| 540 | bool compare_exchange_weak(short&, short, memory_order, |
| 541 | memory_order) volatile; |
| 542 | bool compare_exchange_weak(short&, short, memory_order, memory_order); |
| 543 | bool compare_exchange_strong(short&, short, memory_order, |
| 544 | memory_order) volatile; |
| 545 | bool compare_exchange_strong(short&, short, memory_order, memory_order); |
| 546 | bool compare_exchange_weak(short&, short, |
| 547 | memory_order = memory_order_seq_cst) volatile; |
| 548 | bool compare_exchange_weak(short&, short, |
| 549 | memory_order = memory_order_seq_cst); |
| 550 | bool compare_exchange_strong(short&, short, |
| 551 | memory_order = memory_order_seq_cst) volatile; |
| 552 | bool compare_exchange_strong(short&, short, |
| 553 | memory_order = memory_order_seq_cst); |
| 554 | short fetch_add(short, memory_order = memory_order_seq_cst) volatile; |
| 555 | short fetch_add(short, memory_order = memory_order_seq_cst); |
| 556 | short fetch_sub(short, memory_order = memory_order_seq_cst) volatile; |
| 557 | short fetch_sub(short, memory_order = memory_order_seq_cst); |
| 558 | short fetch_and(short, memory_order = memory_order_seq_cst) volatile; |
| 559 | short fetch_and(short, memory_order = memory_order_seq_cst); |
| 560 | short fetch_or(short, memory_order = memory_order_seq_cst) volatile; |
| 561 | short fetch_or(short, memory_order = memory_order_seq_cst); |
| 562 | short fetch_xor(short, memory_order = memory_order_seq_cst) volatile; |
| 563 | short fetch_xor(short, memory_order = memory_order_seq_cst); |
| 564 | atomic_short() = default; |
| 565 | constexpr atomic_short(short); |
| 566 | atomic_short(const atomic_short&) = delete; |
| 567 | atomic_short& operator=(const atomic_short&) = delete; |
| 568 | atomic_short& operator=(const atomic_short&) volatile = delete; |
| 569 | short operator=(short) volatile; |
| 570 | short operator=(short); |
| 571 | short operator++(int) volatile; |
| 572 | short operator++(int); |
| 573 | short operator--(int) volatile; |
| 574 | short operator--(int); |
| 575 | short operator++() volatile; |
| 576 | short operator++(); |
| 577 | short operator--() volatile; |
| 578 | short operator--(); |
| 579 | short operator+=(short) volatile; |
| 580 | short operator+=(short); |
| 581 | short operator-=(short) volatile; |
| 582 | short operator-=(short); |
| 583 | short operator&=(short) volatile; |
| 584 | short operator&=(short); |
| 585 | short operator|=(short) volatile; |
| 586 | short operator|=(short); |
| 587 | short operator^=(short) volatile; |
| 588 | short operator^=(short); |
| 589 | } atomic_short; |
| 590 | |
| 591 | bool atomic_is_lock_free(const volatile atomic_short*); |
| 592 | bool atomic_is_lock_free(const atomic_short*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 593 | void atomic_init(volatile atomic_short*, short); |
| 594 | void atomic_init(atomic_short*, short); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 595 | void atomic_store(volatile atomic_short*, short); |
| 596 | void atomic_store(atomic_short*, short); |
| 597 | void atomic_store_explicit(volatile atomic_short*, short, memory_order); |
| 598 | void atomic_store_explicit(atomic_short*, short, memory_order); |
| 599 | short atomic_load(const volatile atomic_short*); |
| 600 | short atomic_load(const atomic_short*); |
| 601 | short atomic_load_explicit(const volatile atomic_short*, memory_order); |
| 602 | short atomic_load_explicit(const atomic_short*, memory_order); |
| 603 | short atomic_exchange(volatile atomic_short*, short); |
| 604 | short atomic_exchange(atomic_short*, short); |
| 605 | short atomic_exchange_explicit(volatile atomic_short*, short, memory_order); |
| 606 | short atomic_exchange_explicit(atomic_short*, short, memory_order); |
| 607 | bool atomic_compare_exchange_weak(volatile atomic_short*, short*, short); |
| 608 | bool atomic_compare_exchange_weak(atomic_short*, short*, short); |
| 609 | bool atomic_compare_exchange_strong(volatile atomic_short*, short*, short); |
| 610 | bool atomic_compare_exchange_strong(atomic_short*, short*, short); |
| 611 | bool atomic_compare_exchange_weak_explicit(volatile atomic_short*, short*, |
| 612 | short, memory_order, memory_order); |
| 613 | bool atomic_compare_exchange_weak_explicit(atomic_short*, short*, short, |
| 614 | memory_order, memory_order); |
| 615 | bool atomic_compare_exchange_strong_explicit(volatile atomic_short*, short*, |
| 616 | short, memory_order, memory_order); |
| 617 | bool atomic_compare_exchange_strong_explicit(atomic_short*, short*, short, |
| 618 | memory_order, memory_order); |
| 619 | short atomic_fetch_add(volatile atomic_short*, short); |
| 620 | short atomic_fetch_add(atomic_short*, short); |
| 621 | short atomic_fetch_add_explicit(volatile atomic_short*, short, memory_order); |
| 622 | short atomic_fetch_add_explicit(atomic_short*, short, memory_order); |
| 623 | short atomic_fetch_sub(volatile atomic_short*, short); |
| 624 | short atomic_fetch_sub(atomic_short*, short); |
| 625 | short atomic_fetch_sub_explicit(volatile atomic_short*, short, memory_order); |
| 626 | short atomic_fetch_sub_explicit(atomic_short*, short, memory_order); |
| 627 | short atomic_fetch_and(volatile atomic_short*, short); |
| 628 | short atomic_fetch_and(atomic_short*, short); |
| 629 | short atomic_fetch_and_explicit(volatile atomic_short*, short, memory_order); |
| 630 | short atomic_fetch_and_explicit(atomic_short*, short, memory_order); |
| 631 | short atomic_fetch_or(volatile atomic_short*, short); |
| 632 | short atomic_fetch_or(atomic_short*, short); |
| 633 | short atomic_fetch_or_explicit(volatile atomic_short*, short, memory_order); |
| 634 | short atomic_fetch_or_explicit(atomic_short*, short, memory_order); |
| 635 | short atomic_fetch_xor(volatile atomic_short*, short); |
| 636 | short atomic_fetch_xor(atomic_short*, short); |
| 637 | short atomic_fetch_xor_explicit(volatile atomic_short*, short, memory_order); |
| 638 | short atomic_fetch_xor_explicit(atomic_short*, short, memory_order); |
| 639 | |
| 640 | // atomic_ushort |
| 641 | |
| 642 | typedef struct atomic_ushort |
| 643 | { |
| 644 | bool is_lock_free() const volatile; |
| 645 | bool is_lock_free() const; |
| 646 | void store(unsigned short, memory_order = memory_order_seq_cst) volatile; |
| 647 | void store(unsigned short, memory_order = memory_order_seq_cst); |
| 648 | unsigned short load(memory_order = memory_order_seq_cst) const volatile; |
| 649 | unsigned short load(memory_order = memory_order_seq_cst) const; |
| 650 | operator unsigned short() const volatile; |
| 651 | operator unsigned short() const; |
| 652 | unsigned short exchange(unsigned short, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 653 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 654 | unsigned short exchange(unsigned short, |
| 655 | memory_order = memory_order_seq_cst); |
| 656 | bool compare_exchange_weak(unsigned short&, unsigned short, memory_order, |
| 657 | memory_order) volatile; |
| 658 | bool compare_exchange_weak(unsigned short&, unsigned short, memory_order, |
| 659 | memory_order); |
| 660 | bool compare_exchange_strong(unsigned short&, unsigned short, memory_order, |
| 661 | memory_order) volatile; |
| 662 | bool compare_exchange_strong(unsigned short&, unsigned short, memory_order, |
| 663 | memory_order); |
| 664 | bool compare_exchange_weak(unsigned short&, unsigned short, |
| 665 | memory_order = memory_order_seq_cst) volatile; |
| 666 | bool compare_exchange_weak(unsigned short&, unsigned short, |
| 667 | memory_order = memory_order_seq_cst); |
| 668 | bool compare_exchange_strong(unsigned short&, unsigned short, |
| 669 | memory_order = memory_order_seq_cst) volatile; |
| 670 | bool compare_exchange_strong(unsigned short&, unsigned short, |
| 671 | memory_order = memory_order_seq_cst); |
| 672 | unsigned short fetch_add(unsigned short, |
| 673 | memory_order = memory_order_seq_cst) volatile; |
| 674 | unsigned short fetch_add(unsigned short, |
| 675 | memory_order = memory_order_seq_cst); |
| 676 | unsigned short fetch_sub(unsigned short, |
| 677 | memory_order = memory_order_seq_cst) volatile; |
| 678 | unsigned short fetch_sub(unsigned short, |
| 679 | memory_order = memory_order_seq_cst); |
| 680 | unsigned short fetch_and(unsigned short, |
| 681 | memory_order = memory_order_seq_cst) volatile; |
| 682 | unsigned short fetch_and(unsigned short, |
| 683 | memory_order = memory_order_seq_cst); |
| 684 | unsigned short fetch_or(unsigned short, |
| 685 | memory_order = memory_order_seq_cst) volatile; |
| 686 | unsigned short fetch_or(unsigned short, |
| 687 | memory_order = memory_order_seq_cst); |
| 688 | unsigned short fetch_xor(unsigned short, |
| 689 | memory_order = memory_order_seq_cst) volatile; |
| 690 | unsigned short fetch_xor(unsigned short, |
| 691 | memory_order = memory_order_seq_cst); |
| 692 | atomic_ushort() = default; |
| 693 | constexpr atomic_ushort(unsigned short); |
| 694 | atomic_ushort(const atomic_ushort&) = delete; |
| 695 | atomic_ushort& operator=(const atomic_ushort&) = delete; |
| 696 | atomic_ushort& operator=(const atomic_ushort&) volatile = delete; |
| 697 | unsigned short operator=(unsigned short) volatile; |
| 698 | unsigned short operator=(unsigned short); |
| 699 | unsigned short operator++(int) volatile; |
| 700 | unsigned short operator++(int); |
| 701 | unsigned short operator--(int) volatile; |
| 702 | unsigned short operator--(int); |
| 703 | unsigned short operator++() volatile; |
| 704 | unsigned short operator++(); |
| 705 | unsigned short operator--() volatile; |
| 706 | unsigned short operator--(); |
| 707 | unsigned short operator+=(unsigned short) volatile; |
| 708 | unsigned short operator+=(unsigned short); |
| 709 | unsigned short operator-=(unsigned short) volatile; |
| 710 | unsigned short operator-=(unsigned short); |
| 711 | unsigned short operator&=(unsigned short) volatile; |
| 712 | unsigned short operator&=(unsigned short); |
| 713 | unsigned short operator|=(unsigned short) volatile; |
| 714 | unsigned short operator|=(unsigned short); |
| 715 | unsigned short operator^=(unsigned short) volatile; |
| 716 | unsigned short operator^=(unsigned short); |
| 717 | } atomic_ushort; |
| 718 | |
| 719 | bool atomic_is_lock_free(const volatile atomic_ushort*); |
| 720 | bool atomic_is_lock_free(const atomic_ushort*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 721 | void atomic_init(volatile atomic_ushort*, unsigned short); |
| 722 | void atomic_init(atomic_ushort*, unsigned short); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 723 | void atomic_store(volatile atomic_ushort*, unsigned short); |
| 724 | void atomic_store(atomic_ushort*, unsigned short); |
| 725 | void atomic_store_explicit(volatile atomic_ushort*, unsigned short, |
| 726 | memory_order); |
| 727 | void atomic_store_explicit(atomic_ushort*, unsigned short, memory_order); |
| 728 | unsigned short atomic_load(const volatile atomic_ushort*); |
| 729 | unsigned short atomic_load(const atomic_ushort*); |
| 730 | unsigned short atomic_load_explicit(const volatile atomic_ushort*, |
| 731 | memory_order); |
| 732 | unsigned short atomic_load_explicit(const atomic_ushort*, memory_order); |
| 733 | unsigned short atomic_exchange(volatile atomic_ushort*, unsigned short); |
| 734 | unsigned short atomic_exchange(atomic_ushort*, unsigned short); |
| 735 | unsigned short atomic_exchange_explicit(volatile atomic_ushort*, unsigned short, |
| 736 | memory_order); |
| 737 | unsigned short atomic_exchange_explicit(atomic_ushort*, unsigned short, |
| 738 | memory_order); |
| 739 | bool atomic_compare_exchange_weak(volatile atomic_ushort*, unsigned short*, |
| 740 | unsigned short); |
| 741 | bool atomic_compare_exchange_weak(atomic_ushort*, unsigned short*, |
| 742 | unsigned short); |
| 743 | bool atomic_compare_exchange_strong(volatile atomic_ushort*, unsigned short*, |
| 744 | unsigned short); |
| 745 | bool atomic_compare_exchange_strong(atomic_ushort*, unsigned short*, |
| 746 | unsigned short); |
| 747 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ushort*, |
| 748 | unsigned short*, unsigned short, |
| 749 | memory_order, memory_order); |
| 750 | bool atomic_compare_exchange_weak_explicit(atomic_ushort*, unsigned short*, |
| 751 | unsigned short, memory_order, |
| 752 | memory_order); |
| 753 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ushort*, |
| 754 | unsigned short*, unsigned short, |
| 755 | memory_order, memory_order); |
| 756 | bool atomic_compare_exchange_strong_explicit(atomic_ushort*, unsigned short*, |
| 757 | unsigned short, memory_order, |
| 758 | memory_order); |
| 759 | unsigned short atomic_fetch_add(volatile atomic_ushort*, unsigned short); |
| 760 | unsigned short atomic_fetch_add(atomic_ushort*, unsigned short); |
| 761 | unsigned short atomic_fetch_add_explicit(volatile atomic_ushort*, |
| 762 | unsigned short, memory_order); |
| 763 | unsigned short atomic_fetch_add_explicit(atomic_ushort*, unsigned short, |
| 764 | memory_order); |
| 765 | unsigned short atomic_fetch_sub(volatile atomic_ushort*, unsigned short); |
| 766 | unsigned short atomic_fetch_sub(atomic_ushort*, unsigned short); |
| 767 | unsigned short atomic_fetch_sub_explicit(volatile atomic_ushort*, |
| 768 | unsigned short, memory_order); |
| 769 | unsigned short atomic_fetch_sub_explicit(atomic_ushort*, unsigned short, |
| 770 | memory_order); |
| 771 | unsigned short atomic_fetch_and(volatile atomic_ushort*, unsigned short); |
| 772 | unsigned short atomic_fetch_and(atomic_ushort*, unsigned short); |
| 773 | unsigned short atomic_fetch_and_explicit(volatile atomic_ushort*, |
| 774 | unsigned short, memory_order); |
| 775 | unsigned short atomic_fetch_and_explicit(atomic_ushort*, unsigned short, |
| 776 | memory_order); |
| 777 | unsigned short atomic_fetch_or(volatile atomic_ushort*, unsigned short); |
| 778 | unsigned short atomic_fetch_or(atomic_ushort*, unsigned short); |
| 779 | unsigned short atomic_fetch_or_explicit(volatile atomic_ushort*, unsigned short, |
| 780 | memory_order); |
| 781 | unsigned short atomic_fetch_or_explicit(atomic_ushort*, unsigned short, |
| 782 | memory_order); |
| 783 | unsigned short atomic_fetch_xor(volatile atomic_ushort*, unsigned short); |
| 784 | unsigned short atomic_fetch_xor(atomic_ushort*, unsigned short); |
| 785 | unsigned short atomic_fetch_xor_explicit(volatile atomic_ushort*, |
| 786 | unsigned short, memory_order); |
| 787 | unsigned short atomic_fetch_xor_explicit(atomic_ushort*, unsigned short, |
| 788 | memory_order); |
| 789 | |
| 790 | // atomic_int |
| 791 | |
| 792 | typedef struct atomic_int |
| 793 | { |
| 794 | bool is_lock_free() const volatile; |
| 795 | bool is_lock_free() const; |
| 796 | void store(int, memory_order = memory_order_seq_cst) volatile; |
| 797 | void store(int, memory_order = memory_order_seq_cst); |
| 798 | int load(memory_order = memory_order_seq_cst) const volatile; |
| 799 | int load(memory_order = memory_order_seq_cst) const; |
| 800 | operator int() const volatile; |
| 801 | operator int() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 802 | int exchange(int, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 803 | int exchange(int, memory_order = memory_order_seq_cst); |
| 804 | bool compare_exchange_weak(int&, int, memory_order, memory_order) volatile; |
| 805 | bool compare_exchange_weak(int&, int, memory_order, memory_order); |
| 806 | bool compare_exchange_strong(int&, int, memory_order, |
| 807 | memory_order) volatile; |
| 808 | bool compare_exchange_strong(int&, int, memory_order, memory_order); |
| 809 | bool compare_exchange_weak(int&, int, |
| 810 | memory_order = memory_order_seq_cst) volatile; |
| 811 | bool compare_exchange_weak(int&, int, memory_order = memory_order_seq_cst); |
| 812 | bool compare_exchange_strong(int&, int, |
| 813 | memory_order = memory_order_seq_cst) volatile; |
| 814 | bool compare_exchange_strong(int&, int, |
| 815 | memory_order = memory_order_seq_cst); |
| 816 | int fetch_add(int, memory_order = memory_order_seq_cst) volatile; |
| 817 | int fetch_add(int, memory_order = memory_order_seq_cst); |
| 818 | int fetch_sub(int, memory_order = memory_order_seq_cst) volatile; |
| 819 | int fetch_sub(int, memory_order = memory_order_seq_cst); |
| 820 | int fetch_and(int, memory_order = memory_order_seq_cst) volatile; |
| 821 | int fetch_and(int, memory_order = memory_order_seq_cst); |
| 822 | int fetch_or(int, memory_order = memory_order_seq_cst) volatile; |
| 823 | int fetch_or(int, memory_order = memory_order_seq_cst); |
| 824 | int fetch_xor(int, memory_order = memory_order_seq_cst) volatile; |
| 825 | int fetch_xor(int, memory_order = memory_order_seq_cst); |
| 826 | atomic_int() = default; |
| 827 | constexpr atomic_int(int); |
| 828 | atomic_int(const atomic_int&) = delete; |
| 829 | atomic_int& operator=(const atomic_int&) = delete; |
| 830 | atomic_int& operator=(const atomic_int&) volatile = delete; |
| 831 | int operator=(int) volatile; |
| 832 | int operator=(int); |
| 833 | int operator++(int) volatile; |
| 834 | int operator++(int); |
| 835 | int operator--(int) volatile; |
| 836 | int operator--(int); |
| 837 | int operator++() volatile; |
| 838 | int operator++(); |
| 839 | int operator--() volatile; |
| 840 | int operator--(); |
| 841 | int operator+=(int) volatile; |
| 842 | int operator+=(int); |
| 843 | int operator-=(int) volatile; |
| 844 | int operator-=(int); |
| 845 | int operator&=(int) volatile; |
| 846 | int operator&=(int); |
| 847 | int operator|=(int) volatile; |
| 848 | int operator|=(int); |
| 849 | int operator^=(int) volatile; |
| 850 | int operator^=(int); |
| 851 | } atomic_int; |
| 852 | |
| 853 | bool atomic_is_lock_free(const volatile atomic_int*); |
| 854 | bool atomic_is_lock_free(const atomic_int*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 855 | void atomic_init(volatile atomic_int*, int); |
| 856 | void atomic_init(atomic_int*, int); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 857 | void atomic_store(volatile atomic_int*, int); |
| 858 | void atomic_store(atomic_int*, int); |
| 859 | void atomic_store_explicit(volatile atomic_int*, int, memory_order); |
| 860 | void atomic_store_explicit(atomic_int*, int, memory_order); |
| 861 | int atomic_load(const volatile atomic_int*); |
| 862 | int atomic_load(const atomic_int*); |
| 863 | int atomic_load_explicit(const volatile atomic_int*, memory_order); |
| 864 | int atomic_load_explicit(const atomic_int*, memory_order); |
| 865 | int atomic_exchange(volatile atomic_int*, int); |
| 866 | int atomic_exchange(atomic_int*, int); |
| 867 | int atomic_exchange_explicit(volatile atomic_int*, int, memory_order); |
| 868 | int atomic_exchange_explicit(atomic_int*, int, memory_order); |
| 869 | bool atomic_compare_exchange_weak(volatile atomic_int*, int*, int); |
| 870 | bool atomic_compare_exchange_weak(atomic_int*, int*, int); |
| 871 | bool atomic_compare_exchange_strong(volatile atomic_int*, int*, int); |
| 872 | bool atomic_compare_exchange_strong(atomic_int*, int*, int); |
| 873 | bool atomic_compare_exchange_weak_explicit(volatile atomic_int*, int*, int, |
| 874 | memory_order, memory_order); |
| 875 | bool atomic_compare_exchange_weak_explicit(atomic_int*, int*, int, memory_order, |
| 876 | memory_order); |
| 877 | bool atomic_compare_exchange_strong_explicit(volatile atomic_int*, int*, int, |
| 878 | memory_order, memory_order); |
| 879 | bool atomic_compare_exchange_strong_explicit(atomic_int*, int*, int, |
| 880 | memory_order, memory_order); |
| 881 | int atomic_fetch_add(volatile atomic_int*, int); |
| 882 | int atomic_fetch_add(atomic_int*, int); |
| 883 | int atomic_fetch_add_explicit(volatile atomic_int*, int, memory_order); |
| 884 | int atomic_fetch_add_explicit(atomic_int*, int, memory_order); |
| 885 | int atomic_fetch_sub(volatile atomic_int*, int); |
| 886 | int atomic_fetch_sub(atomic_int*, int); |
| 887 | int atomic_fetch_sub_explicit(volatile atomic_int*, int, memory_order); |
| 888 | int atomic_fetch_sub_explicit(atomic_int*, int, memory_order); |
| 889 | int atomic_fetch_and(volatile atomic_int*, int); |
| 890 | int atomic_fetch_and(atomic_int*, int); |
| 891 | int atomic_fetch_and_explicit(volatile atomic_int*, int, memory_order); |
| 892 | int atomic_fetch_and_explicit(atomic_int*, int, memory_order); |
| 893 | int atomic_fetch_or(volatile atomic_int*, int); |
| 894 | int atomic_fetch_or(atomic_int*, int); |
| 895 | int atomic_fetch_or_explicit(volatile atomic_int*, int, memory_order); |
| 896 | int atomic_fetch_or_explicit(atomic_int*, int, memory_order); |
| 897 | int atomic_fetch_xor(volatile atomic_int*, int); |
| 898 | int atomic_fetch_xor(atomic_int*, int); |
| 899 | int atomic_fetch_xor_explicit(volatile atomic_int*, int, memory_order); |
| 900 | int atomic_fetch_xor_explicit(atomic_int*, int, memory_order); |
| 901 | |
| 902 | // atomic_uint |
| 903 | |
| 904 | typedef struct atomic_uint |
| 905 | { |
| 906 | bool is_lock_free() const volatile; |
| 907 | bool is_lock_free() const; |
| 908 | void store(unsigned int, memory_order = memory_order_seq_cst) volatile; |
| 909 | void store(unsigned int, memory_order = memory_order_seq_cst); |
| 910 | unsigned int load(memory_order = memory_order_seq_cst) const volatile; |
| 911 | unsigned int load(memory_order = memory_order_seq_cst) const; |
| 912 | operator unsigned int() const volatile; |
| 913 | operator unsigned int() const; |
| 914 | unsigned int exchange(unsigned int, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 915 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 916 | unsigned int exchange(unsigned int, memory_order = memory_order_seq_cst); |
| 917 | bool compare_exchange_weak(unsigned int&, unsigned int, memory_order, |
| 918 | memory_order) volatile; |
| 919 | bool compare_exchange_weak(unsigned int&, unsigned int, memory_order, |
| 920 | memory_order); |
| 921 | bool compare_exchange_strong(unsigned int&, unsigned int, memory_order, |
| 922 | memory_order) volatile; |
| 923 | bool compare_exchange_strong(unsigned int&, unsigned int, memory_order, |
| 924 | memory_order); |
| 925 | bool compare_exchange_weak(unsigned int&, unsigned int, |
| 926 | memory_order = memory_order_seq_cst) volatile; |
| 927 | bool compare_exchange_weak(unsigned int&, unsigned int, |
| 928 | memory_order = memory_order_seq_cst); |
| 929 | bool compare_exchange_strong(unsigned int&, unsigned int, |
| 930 | memory_order = memory_order_seq_cst) volatile; |
| 931 | bool compare_exchange_strong(unsigned int&, unsigned int, |
| 932 | memory_order = memory_order_seq_cst); |
| 933 | unsigned int fetch_add(unsigned int, |
| 934 | memory_order = memory_order_seq_cst) volatile; |
| 935 | unsigned int fetch_add(unsigned int, memory_order = memory_order_seq_cst); |
| 936 | unsigned int fetch_sub(unsigned int, |
| 937 | memory_order = memory_order_seq_cst) volatile; |
| 938 | unsigned int fetch_sub(unsigned int, memory_order = memory_order_seq_cst); |
| 939 | unsigned int fetch_and(unsigned int, |
| 940 | memory_order = memory_order_seq_cst) volatile; |
| 941 | unsigned int fetch_and(unsigned int, memory_order = memory_order_seq_cst); |
| 942 | unsigned int fetch_or(unsigned int, |
| 943 | memory_order = memory_order_seq_cst) volatile; |
| 944 | unsigned int fetch_or(unsigned int, memory_order = memory_order_seq_cst); |
| 945 | unsigned int fetch_xor(unsigned int, |
| 946 | memory_order = memory_order_seq_cst) volatile; |
| 947 | unsigned int fetch_xor(unsigned int, memory_order = memory_order_seq_cst); |
| 948 | atomic_uint() = default; |
| 949 | constexpr atomic_uint(unsigned int); |
| 950 | atomic_uint(const atomic_uint&) = delete; |
| 951 | atomic_uint& operator=(const atomic_uint&) = delete; |
| 952 | atomic_uint& operator=(const atomic_uint&) volatile = delete; |
| 953 | unsigned int operator=(unsigned int) volatile; |
| 954 | unsigned int operator=(unsigned int); |
| 955 | unsigned int operator++(int) volatile; |
| 956 | unsigned int operator++(int); |
| 957 | unsigned int operator--(int) volatile; |
| 958 | unsigned int operator--(int); |
| 959 | unsigned int operator++() volatile; |
| 960 | unsigned int operator++(); |
| 961 | unsigned int operator--() volatile; |
| 962 | unsigned int operator--(); |
| 963 | unsigned int operator+=(unsigned int) volatile; |
| 964 | unsigned int operator+=(unsigned int); |
| 965 | unsigned int operator-=(unsigned int) volatile; |
| 966 | unsigned int operator-=(unsigned int); |
| 967 | unsigned int operator&=(unsigned int) volatile; |
| 968 | unsigned int operator&=(unsigned int); |
| 969 | unsigned int operator|=(unsigned int) volatile; |
| 970 | unsigned int operator|=(unsigned int); |
| 971 | unsigned int operator^=(unsigned int) volatile; |
| 972 | unsigned int operator^=(unsigned int); |
| 973 | } atomic_uint; |
| 974 | |
| 975 | bool atomic_is_lock_free(const volatile atomic_uint*); |
| 976 | bool atomic_is_lock_free(const atomic_uint*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 977 | void atomic_init(volatile atomic_uint*, unsigned int); |
| 978 | void atomic_init(atomic_uint*, unsigned int); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 979 | void atomic_store(volatile atomic_uint*, unsigned int); |
| 980 | void atomic_store(atomic_uint*, unsigned int); |
| 981 | void atomic_store_explicit(volatile atomic_uint*, unsigned int, memory_order); |
| 982 | void atomic_store_explicit(atomic_uint*, unsigned int, memory_order); |
| 983 | unsigned int atomic_load(const volatile atomic_uint*); |
| 984 | unsigned int atomic_load(const atomic_uint*); |
| 985 | unsigned int atomic_load_explicit(const volatile atomic_uint*, memory_order); |
| 986 | unsigned int atomic_load_explicit(const atomic_uint*, memory_order); |
| 987 | unsigned int atomic_exchange(volatile atomic_uint*, unsigned int); |
| 988 | unsigned int atomic_exchange(atomic_uint*, unsigned int); |
| 989 | unsigned int atomic_exchange_explicit(volatile atomic_uint*, unsigned int, |
| 990 | memory_order); |
| 991 | unsigned int atomic_exchange_explicit(atomic_uint*, unsigned int, memory_order); |
| 992 | bool atomic_compare_exchange_weak(volatile atomic_uint*, unsigned int*, |
| 993 | unsigned int); |
| 994 | bool atomic_compare_exchange_weak(atomic_uint*, unsigned int*, unsigned int); |
| 995 | bool atomic_compare_exchange_strong(volatile atomic_uint*, unsigned int*, |
| 996 | unsigned int); |
| 997 | bool atomic_compare_exchange_strong(atomic_uint*, unsigned int*, unsigned int); |
| 998 | bool atomic_compare_exchange_weak_explicit(volatile atomic_uint*, unsigned int*, |
| 999 | unsigned int, memory_order, |
| 1000 | memory_order); |
| 1001 | bool atomic_compare_exchange_weak_explicit(atomic_uint*, unsigned int*, |
| 1002 | unsigned int, memory_order, |
| 1003 | memory_order); |
| 1004 | bool atomic_compare_exchange_strong_explicit(volatile atomic_uint*, |
| 1005 | unsigned int*, unsigned int, |
| 1006 | memory_order, memory_order); |
| 1007 | bool atomic_compare_exchange_strong_explicit(atomic_uint*, unsigned int*, |
| 1008 | unsigned int, memory_order, |
| 1009 | memory_order); |
| 1010 | unsigned int atomic_fetch_add(volatile atomic_uint*, unsigned int); |
| 1011 | unsigned int atomic_fetch_add(atomic_uint*, unsigned int); |
| 1012 | unsigned int atomic_fetch_add_explicit(volatile atomic_uint*, unsigned int, |
| 1013 | memory_order); |
| 1014 | unsigned int atomic_fetch_add_explicit(atomic_uint*, unsigned int, |
| 1015 | memory_order); |
| 1016 | unsigned int atomic_fetch_sub(volatile atomic_uint*, unsigned int); |
| 1017 | unsigned int atomic_fetch_sub(atomic_uint*, unsigned int); |
| 1018 | unsigned int atomic_fetch_sub_explicit(volatile atomic_uint*, unsigned int, |
| 1019 | memory_order); |
| 1020 | unsigned int atomic_fetch_sub_explicit(atomic_uint*, unsigned int, |
| 1021 | memory_order); |
| 1022 | unsigned int atomic_fetch_and(volatile atomic_uint*, unsigned int); |
| 1023 | unsigned int atomic_fetch_and(atomic_uint*, unsigned int); |
| 1024 | unsigned int atomic_fetch_and_explicit(volatile atomic_uint*, unsigned int, |
| 1025 | memory_order); |
| 1026 | unsigned int atomic_fetch_and_explicit(atomic_uint*, unsigned int, |
| 1027 | memory_order); |
| 1028 | unsigned int atomic_fetch_or(volatile atomic_uint*, unsigned int); |
| 1029 | unsigned int atomic_fetch_or(atomic_uint*, unsigned int); |
| 1030 | unsigned int atomic_fetch_or_explicit(volatile atomic_uint*, unsigned int, |
| 1031 | memory_order); |
| 1032 | unsigned int atomic_fetch_or_explicit(atomic_uint*, unsigned int, memory_order); |
| 1033 | unsigned int atomic_fetch_xor(volatile atomic_uint*, unsigned int); |
| 1034 | unsigned int atomic_fetch_xor(atomic_uint*, unsigned int); |
| 1035 | unsigned int atomic_fetch_xor_explicit(volatile atomic_uint*, unsigned int, |
| 1036 | memory_order); |
| 1037 | unsigned int atomic_fetch_xor_explicit(atomic_uint*, unsigned int, |
| 1038 | memory_order); |
| 1039 | |
| 1040 | // atomic_long |
| 1041 | |
| 1042 | typedef struct atomic_long |
| 1043 | { |
| 1044 | bool is_lock_free() const volatile; |
| 1045 | bool is_lock_free() const; |
| 1046 | void store(long, memory_order = memory_order_seq_cst) volatile; |
| 1047 | void store(long, memory_order = memory_order_seq_cst); |
| 1048 | long load(memory_order = memory_order_seq_cst) const volatile; |
| 1049 | long load(memory_order = memory_order_seq_cst) const; |
| 1050 | operator long() const volatile; |
| 1051 | operator long() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1052 | long exchange(long, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1053 | long exchange(long, memory_order = memory_order_seq_cst); |
| 1054 | bool compare_exchange_weak(long&, long, memory_order, |
| 1055 | memory_order) volatile; |
| 1056 | bool compare_exchange_weak(long&, long, memory_order, memory_order); |
| 1057 | bool compare_exchange_strong(long&, long, memory_order, |
| 1058 | memory_order) volatile; |
| 1059 | bool compare_exchange_strong(long&, long, memory_order, memory_order); |
| 1060 | bool compare_exchange_weak(long&, long, |
| 1061 | memory_order = memory_order_seq_cst) volatile; |
| 1062 | bool compare_exchange_weak(long&, long, |
| 1063 | memory_order = memory_order_seq_cst); |
| 1064 | bool compare_exchange_strong(long&, long, |
| 1065 | memory_order = memory_order_seq_cst) volatile; |
| 1066 | bool compare_exchange_strong(long&, long, |
| 1067 | memory_order = memory_order_seq_cst); |
| 1068 | long fetch_add(long, memory_order = memory_order_seq_cst) volatile; |
| 1069 | long fetch_add(long, memory_order = memory_order_seq_cst); |
| 1070 | long fetch_sub(long, memory_order = memory_order_seq_cst) volatile; |
| 1071 | long fetch_sub(long, memory_order = memory_order_seq_cst); |
| 1072 | long fetch_and(long, memory_order = memory_order_seq_cst) volatile; |
| 1073 | long fetch_and(long, memory_order = memory_order_seq_cst); |
| 1074 | long fetch_or(long, memory_order = memory_order_seq_cst) volatile; |
| 1075 | long fetch_or(long, memory_order = memory_order_seq_cst); |
| 1076 | long fetch_xor(long, memory_order = memory_order_seq_cst) volatile; |
| 1077 | long fetch_xor(long, memory_order = memory_order_seq_cst); |
| 1078 | atomic_long() = default; |
| 1079 | constexpr atomic_long(long); |
| 1080 | atomic_long(const atomic_long&) = delete; |
| 1081 | atomic_long& operator=(const atomic_long&) = delete; |
| 1082 | atomic_long& operator=(const atomic_long&) volatile = delete; |
| 1083 | long operator=(long) volatile; |
| 1084 | long operator=(long); |
| 1085 | long operator++(int) volatile; |
| 1086 | long operator++(int); |
| 1087 | long operator--(int) volatile; |
| 1088 | long operator--(int); |
| 1089 | long operator++() volatile; |
| 1090 | long operator++(); |
| 1091 | long operator--() volatile; |
| 1092 | long operator--(); |
| 1093 | long operator+=(long) volatile; |
| 1094 | long operator+=(long); |
| 1095 | long operator-=(long) volatile; |
| 1096 | long operator-=(long); |
| 1097 | long operator&=(long) volatile; |
| 1098 | long operator&=(long); |
| 1099 | long operator|=(long) volatile; |
| 1100 | long operator|=(long); |
| 1101 | long operator^=(long) volatile; |
| 1102 | long operator^=(long); |
| 1103 | } atomic_long; |
| 1104 | |
| 1105 | bool atomic_is_lock_free(const volatile atomic_long*); |
| 1106 | bool atomic_is_lock_free(const atomic_long*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1107 | void atomic_init(volatile atomic_long*, long); |
| 1108 | void atomic_init(atomic_long*, long); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1109 | void atomic_store(volatile atomic_long*, long); |
| 1110 | void atomic_store(atomic_long*, long); |
| 1111 | void atomic_store_explicit(volatile atomic_long*, long, memory_order); |
| 1112 | void atomic_store_explicit(atomic_long*, long, memory_order); |
| 1113 | long atomic_load(const volatile atomic_long*); |
| 1114 | long atomic_load(const atomic_long*); |
| 1115 | long atomic_load_explicit(const volatile atomic_long*, memory_order); |
| 1116 | long atomic_load_explicit(const atomic_long*, memory_order); |
| 1117 | long atomic_exchange(volatile atomic_long*, long); |
| 1118 | long atomic_exchange(atomic_long*, long); |
| 1119 | long atomic_exchange_explicit(volatile atomic_long*, long, memory_order); |
| 1120 | long atomic_exchange_explicit(atomic_long*, long, memory_order); |
| 1121 | bool atomic_compare_exchange_weak(volatile atomic_long*, long*, long); |
| 1122 | bool atomic_compare_exchange_weak(atomic_long*, long*, long); |
| 1123 | bool atomic_compare_exchange_strong(volatile atomic_long*, long*, long); |
| 1124 | bool atomic_compare_exchange_strong(atomic_long*, long*, long); |
| 1125 | bool atomic_compare_exchange_weak_explicit(volatile atomic_long*, long*, long, |
| 1126 | memory_order, memory_order); |
| 1127 | bool atomic_compare_exchange_weak_explicit(atomic_long*, long*, long, |
| 1128 | memory_order, memory_order); |
| 1129 | bool atomic_compare_exchange_strong_explicit(volatile atomic_long*, long*, long, |
| 1130 | memory_order, memory_order); |
| 1131 | bool atomic_compare_exchange_strong_explicit(atomic_long*, long*, long, |
| 1132 | memory_order, memory_order); |
| 1133 | long atomic_fetch_add(volatile atomic_long*, long); |
| 1134 | long atomic_fetch_add(atomic_long*, long); |
| 1135 | long atomic_fetch_add_explicit(volatile atomic_long*, long, memory_order); |
| 1136 | long atomic_fetch_add_explicit(atomic_long*, long, memory_order); |
| 1137 | long atomic_fetch_sub(volatile atomic_long*, long); |
| 1138 | long atomic_fetch_sub(atomic_long*, long); |
| 1139 | long atomic_fetch_sub_explicit(volatile atomic_long*, long, memory_order); |
| 1140 | long atomic_fetch_sub_explicit(atomic_long*, long, memory_order); |
| 1141 | long atomic_fetch_and(volatile atomic_long*, long); |
| 1142 | long atomic_fetch_and(atomic_long*, long); |
| 1143 | long atomic_fetch_and_explicit(volatile atomic_long*, long, memory_order); |
| 1144 | long atomic_fetch_and_explicit(atomic_long*, long, memory_order); |
| 1145 | long atomic_fetch_or(volatile atomic_long*, long); |
| 1146 | long atomic_fetch_or(atomic_long*, long); |
| 1147 | long atomic_fetch_or_explicit(volatile atomic_long*, long, memory_order); |
| 1148 | long atomic_fetch_or_explicit(atomic_long*, long, memory_order); |
| 1149 | long atomic_fetch_xor(volatile atomic_long*, long); |
| 1150 | long atomic_fetch_xor(atomic_long*, long); |
| 1151 | long atomic_fetch_xor_explicit(volatile atomic_long*, long, memory_order); |
| 1152 | long atomic_fetch_xor_explicit(atomic_long*, long, memory_order); |
| 1153 | |
| 1154 | // atomic_ulong |
| 1155 | |
| 1156 | typedef struct atomic_ulong |
| 1157 | { |
| 1158 | bool is_lock_free() const volatile; |
| 1159 | bool is_lock_free() const; |
| 1160 | void store(unsigned long, memory_order = memory_order_seq_cst) volatile; |
| 1161 | void store(unsigned long, memory_order = memory_order_seq_cst); |
| 1162 | unsigned long load(memory_order = memory_order_seq_cst) const volatile; |
| 1163 | unsigned long load(memory_order = memory_order_seq_cst) const; |
| 1164 | operator unsigned long() const volatile; |
| 1165 | operator unsigned long() const; |
| 1166 | unsigned long exchange(unsigned long, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1167 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1168 | unsigned long exchange(unsigned long, memory_order = memory_order_seq_cst); |
| 1169 | bool compare_exchange_weak(unsigned long&, unsigned long, memory_order, |
| 1170 | memory_order) volatile; |
| 1171 | bool compare_exchange_weak(unsigned long&, unsigned long, memory_order, |
| 1172 | memory_order); |
| 1173 | bool compare_exchange_strong(unsigned long&, unsigned long, memory_order, |
| 1174 | memory_order) volatile; |
| 1175 | bool compare_exchange_strong(unsigned long&, unsigned long, memory_order, |
| 1176 | memory_order); |
| 1177 | bool compare_exchange_weak(unsigned long&, unsigned long, |
| 1178 | memory_order = memory_order_seq_cst) volatile; |
| 1179 | bool compare_exchange_weak(unsigned long&, unsigned long, |
| 1180 | memory_order = memory_order_seq_cst); |
| 1181 | bool compare_exchange_strong(unsigned long&, unsigned long, |
| 1182 | memory_order = memory_order_seq_cst) volatile; |
| 1183 | bool compare_exchange_strong(unsigned long&, unsigned long, |
| 1184 | memory_order = memory_order_seq_cst); |
| 1185 | unsigned long fetch_add(unsigned long, |
| 1186 | memory_order = memory_order_seq_cst) volatile; |
| 1187 | unsigned long fetch_add(unsigned long, memory_order = memory_order_seq_cst); |
| 1188 | unsigned long fetch_sub(unsigned long, |
| 1189 | memory_order = memory_order_seq_cst) volatile; |
| 1190 | unsigned long fetch_sub(unsigned long, memory_order = memory_order_seq_cst); |
| 1191 | unsigned long fetch_and(unsigned long, |
| 1192 | memory_order = memory_order_seq_cst) volatile; |
| 1193 | unsigned long fetch_and(unsigned long, memory_order = memory_order_seq_cst); |
| 1194 | unsigned long fetch_or(unsigned long, |
| 1195 | memory_order = memory_order_seq_cst) volatile; |
| 1196 | unsigned long fetch_or(unsigned long, memory_order = memory_order_seq_cst); |
| 1197 | unsigned long fetch_xor(unsigned long, |
| 1198 | memory_order = memory_order_seq_cst) volatile; |
| 1199 | unsigned long fetch_xor(unsigned long, memory_order = memory_order_seq_cst); |
| 1200 | atomic_ulong() = default; |
| 1201 | constexpr atomic_ulong(unsigned long); |
| 1202 | atomic_ulong(const atomic_ulong&) = delete; |
| 1203 | atomic_ulong& operator=(const atomic_ulong&) = delete; |
| 1204 | atomic_ulong& operator=(const atomic_ulong&) volatile = delete; |
| 1205 | unsigned long operator=(unsigned long) volatile; |
| 1206 | unsigned long operator=(unsigned long); |
| 1207 | unsigned long operator++(int) volatile; |
| 1208 | unsigned long operator++(int); |
| 1209 | unsigned long operator--(int) volatile; |
| 1210 | unsigned long operator--(int); |
| 1211 | unsigned long operator++() volatile; |
| 1212 | unsigned long operator++(); |
| 1213 | unsigned long operator--() volatile; |
| 1214 | unsigned long operator--(); |
| 1215 | unsigned long operator+=(unsigned long) volatile; |
| 1216 | unsigned long operator+=(unsigned long); |
| 1217 | unsigned long operator-=(unsigned long) volatile; |
| 1218 | unsigned long operator-=(unsigned long); |
| 1219 | unsigned long operator&=(unsigned long) volatile; |
| 1220 | unsigned long operator&=(unsigned long); |
| 1221 | unsigned long operator|=(unsigned long) volatile; |
| 1222 | unsigned long operator|=(unsigned long); |
| 1223 | unsigned long operator^=(unsigned long) volatile; |
| 1224 | unsigned long operator^=(unsigned long); |
| 1225 | } atomic_ulong; |
| 1226 | |
| 1227 | bool atomic_is_lock_free(const volatile atomic_ulong*); |
| 1228 | bool atomic_is_lock_free(const atomic_ulong*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1229 | void atomic_init(volatile atomic_ulong*, unsigned long); |
| 1230 | void atomic_init(atomic_ulong*, unsigned long); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1231 | void atomic_store(volatile atomic_ulong*, unsigned long); |
| 1232 | void atomic_store(atomic_ulong*, unsigned long); |
| 1233 | void atomic_store_explicit(volatile atomic_ulong*, unsigned long, memory_order); |
| 1234 | void atomic_store_explicit(atomic_ulong*, unsigned long, memory_order); |
| 1235 | unsigned long atomic_load(const volatile atomic_ulong*); |
| 1236 | unsigned long atomic_load(const atomic_ulong*); |
| 1237 | unsigned long atomic_load_explicit(const volatile atomic_ulong*, memory_order); |
| 1238 | unsigned long atomic_load_explicit(const atomic_ulong*, memory_order); |
| 1239 | unsigned long atomic_exchange(volatile atomic_ulong*, unsigned long); |
| 1240 | unsigned long atomic_exchange(atomic_ulong*, unsigned long); |
| 1241 | unsigned long atomic_exchange_explicit(volatile atomic_ulong*, unsigned long, |
| 1242 | memory_order); |
| 1243 | unsigned long atomic_exchange_explicit(atomic_ulong*, unsigned long, |
| 1244 | memory_order); |
| 1245 | bool atomic_compare_exchange_weak(volatile atomic_ulong*, unsigned long*, |
| 1246 | unsigned long); |
| 1247 | bool atomic_compare_exchange_weak(atomic_ulong*, unsigned long*, unsigned long); |
| 1248 | bool atomic_compare_exchange_strong(volatile atomic_ulong*, unsigned long*, |
| 1249 | unsigned long); |
| 1250 | bool atomic_compare_exchange_strong(atomic_ulong*, unsigned long*, |
| 1251 | unsigned long); |
| 1252 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ulong*, |
| 1253 | unsigned long*, unsigned long, |
| 1254 | memory_order, memory_order); |
| 1255 | bool atomic_compare_exchange_weak_explicit(atomic_ulong*, unsigned long*, |
| 1256 | unsigned long, memory_order, |
| 1257 | memory_order); |
| 1258 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ulong*, |
| 1259 | unsigned long*, unsigned long, |
| 1260 | memory_order, memory_order); |
| 1261 | bool atomic_compare_exchange_strong_explicit(atomic_ulong*, unsigned long*, |
| 1262 | unsigned long, memory_order, |
| 1263 | memory_order); |
| 1264 | unsigned long atomic_fetch_add(volatile atomic_ulong*, unsigned long); |
| 1265 | unsigned long atomic_fetch_add(atomic_ulong*, unsigned long); |
| 1266 | unsigned long atomic_fetch_add_explicit(volatile atomic_ulong*, unsigned long, |
| 1267 | memory_order); |
| 1268 | unsigned long atomic_fetch_add_explicit(atomic_ulong*, unsigned long, |
| 1269 | memory_order); |
| 1270 | unsigned long atomic_fetch_sub(volatile atomic_ulong*, unsigned long); |
| 1271 | unsigned long atomic_fetch_sub(atomic_ulong*, unsigned long); |
| 1272 | unsigned long atomic_fetch_sub_explicit(volatile atomic_ulong*, unsigned long, |
| 1273 | memory_order); |
| 1274 | unsigned long atomic_fetch_sub_explicit(atomic_ulong*, unsigned long, |
| 1275 | memory_order); |
| 1276 | unsigned long atomic_fetch_and(volatile atomic_ulong*, unsigned long); |
| 1277 | unsigned long atomic_fetch_and(atomic_ulong*, unsigned long); |
| 1278 | unsigned long atomic_fetch_and_explicit(volatile atomic_ulong*, unsigned long, |
| 1279 | memory_order); |
| 1280 | unsigned long atomic_fetch_and_explicit(atomic_ulong*, unsigned long, |
| 1281 | memory_order); |
| 1282 | unsigned long atomic_fetch_or(volatile atomic_ulong*, unsigned long); |
| 1283 | unsigned long atomic_fetch_or(atomic_ulong*, unsigned long); |
| 1284 | unsigned long atomic_fetch_or_explicit(volatile atomic_ulong*, unsigned long, |
| 1285 | memory_order); |
| 1286 | unsigned long atomic_fetch_or_explicit(atomic_ulong*, unsigned long, |
| 1287 | memory_order); |
| 1288 | unsigned long atomic_fetch_xor(volatile atomic_ulong*, unsigned long); |
| 1289 | unsigned long atomic_fetch_xor(atomic_ulong*, unsigned long); |
| 1290 | unsigned long atomic_fetch_xor_explicit(volatile atomic_ulong*, unsigned long, |
| 1291 | memory_order); |
| 1292 | unsigned long atomic_fetch_xor_explicit(atomic_ulong*, unsigned long, |
| 1293 | memory_order); |
| 1294 | |
| 1295 | // atomic_llong |
| 1296 | |
| 1297 | typedef struct atomic_llong |
| 1298 | { |
| 1299 | bool is_lock_free() const volatile; |
| 1300 | bool is_lock_free() const; |
| 1301 | void store(long long, memory_order = memory_order_seq_cst) volatile; |
| 1302 | void store(long long, memory_order = memory_order_seq_cst); |
| 1303 | long long load(memory_order = memory_order_seq_cst) const volatile; |
| 1304 | long long load(memory_order = memory_order_seq_cst) const; |
| 1305 | operator long long() const volatile; |
| 1306 | operator long long() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1307 | long long exchange(long long, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1308 | long long exchange(long long, memory_order = memory_order_seq_cst); |
| 1309 | bool compare_exchange_weak(long long&, long long, memory_order, |
| 1310 | memory_order) volatile; |
| 1311 | bool compare_exchange_weak(long long&, long long, memory_order, |
| 1312 | memory_order); |
| 1313 | bool compare_exchange_strong(long long&, long long, memory_order, |
| 1314 | memory_order) volatile; |
| 1315 | bool compare_exchange_strong(long long&, long long, memory_order, |
| 1316 | memory_order); |
| 1317 | bool compare_exchange_weak(long long&, long long, |
| 1318 | memory_order = memory_order_seq_cst) volatile; |
| 1319 | bool compare_exchange_weak(long long&, long long, |
| 1320 | memory_order = memory_order_seq_cst); |
| 1321 | bool compare_exchange_strong(long long&, long long, |
| 1322 | memory_order = memory_order_seq_cst) volatile; |
| 1323 | bool compare_exchange_strong(long long&, long long, |
| 1324 | memory_order = memory_order_seq_cst); |
| 1325 | long long fetch_add(long long, |
| 1326 | memory_order = memory_order_seq_cst) volatile; |
| 1327 | long long fetch_add(long long, memory_order = memory_order_seq_cst); |
| 1328 | long long fetch_sub(long long, |
| 1329 | memory_order = memory_order_seq_cst) volatile; |
| 1330 | long long fetch_sub(long long, memory_order = memory_order_seq_cst); |
| 1331 | long long fetch_and(long long, |
| 1332 | memory_order = memory_order_seq_cst) volatile; |
| 1333 | long long fetch_and(long long, memory_order = memory_order_seq_cst); |
| 1334 | long long fetch_or(long long, memory_order = memory_order_seq_cst) volatile; |
| 1335 | long long fetch_or(long long, memory_order = memory_order_seq_cst); |
| 1336 | long long fetch_xor(long long, |
| 1337 | memory_order = memory_order_seq_cst) volatile; |
| 1338 | long long fetch_xor(long long, memory_order = memory_order_seq_cst); |
| 1339 | atomic_llong() = default; |
| 1340 | constexpr atomic_llong(long long); |
| 1341 | atomic_llong(const atomic_llong&) = delete; |
| 1342 | atomic_llong& operator=(const atomic_llong&) = delete; |
| 1343 | atomic_llong& operator=(const atomic_llong&) volatile = delete; |
| 1344 | long long operator=(long long) volatile; |
| 1345 | long long operator=(long long); |
| 1346 | long long operator++(int) volatile; |
| 1347 | long long operator++(int); |
| 1348 | long long operator--(int) volatile; |
| 1349 | long long operator--(int); |
| 1350 | long long operator++() volatile; |
| 1351 | long long operator++(); |
| 1352 | long long operator--() volatile; |
| 1353 | long long operator--(); |
| 1354 | long long operator+=(long long) volatile; |
| 1355 | long long operator+=(long long); |
| 1356 | long long operator-=(long long) volatile; |
| 1357 | long long operator-=(long long); |
| 1358 | long long operator&=(long long) volatile; |
| 1359 | long long operator&=(long long); |
| 1360 | long long operator|=(long long) volatile; |
| 1361 | long long operator|=(long long); |
| 1362 | long long operator^=(long long) volatile; |
| 1363 | long long operator^=(long long); |
| 1364 | } atomic_llong; |
| 1365 | |
| 1366 | bool atomic_is_lock_free(const volatile atomic_llong*); |
| 1367 | bool atomic_is_lock_free(const atomic_llong*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1368 | void atomic_init(volatile atomic_llong*, long long); |
| 1369 | void atomic_init(atomic_llong*, long long); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1370 | void atomic_store(volatile atomic_llong*, long long); |
| 1371 | void atomic_store(atomic_llong*, long long); |
| 1372 | void atomic_store_explicit(volatile atomic_llong*, long long, memory_order); |
| 1373 | void atomic_store_explicit(atomic_llong*, long long, memory_order); |
| 1374 | long long atomic_load(const volatile atomic_llong*); |
| 1375 | long long atomic_load(const atomic_llong*); |
| 1376 | long long atomic_load_explicit(const volatile atomic_llong*, memory_order); |
| 1377 | long long atomic_load_explicit(const atomic_llong*, memory_order); |
| 1378 | long long atomic_exchange(volatile atomic_llong*, long long); |
| 1379 | long long atomic_exchange(atomic_llong*, long long); |
| 1380 | long long atomic_exchange_explicit(volatile atomic_llong*, long long, |
| 1381 | memory_order); |
| 1382 | long long atomic_exchange_explicit(atomic_llong*, long long, memory_order); |
| 1383 | bool atomic_compare_exchange_weak(volatile atomic_llong*, long long*, |
| 1384 | long long); |
| 1385 | bool atomic_compare_exchange_weak(atomic_llong*, long long*, long long); |
| 1386 | bool atomic_compare_exchange_strong(volatile atomic_llong*, long long*, |
| 1387 | long long); |
| 1388 | bool atomic_compare_exchange_strong(atomic_llong*, long long*, long long); |
| 1389 | bool atomic_compare_exchange_weak_explicit(volatile atomic_llong*, long long*, |
| 1390 | long long, memory_order, |
| 1391 | memory_order); |
| 1392 | bool atomic_compare_exchange_weak_explicit(atomic_llong*, long long*, long long, |
| 1393 | memory_order, memory_order); |
| 1394 | bool atomic_compare_exchange_strong_explicit(volatile atomic_llong*, long long*, |
| 1395 | long long, memory_order, |
| 1396 | memory_order); |
| 1397 | bool atomic_compare_exchange_strong_explicit(atomic_llong*, long long*, |
| 1398 | long long, memory_order, |
| 1399 | memory_order); |
| 1400 | long long atomic_fetch_add(volatile atomic_llong*, long long); |
| 1401 | long long atomic_fetch_add(atomic_llong*, long long); |
| 1402 | long long atomic_fetch_add_explicit(volatile atomic_llong*, long long, |
| 1403 | memory_order); |
| 1404 | long long atomic_fetch_add_explicit(atomic_llong*, long long, memory_order); |
| 1405 | long long atomic_fetch_sub(volatile atomic_llong*, long long); |
| 1406 | long long atomic_fetch_sub(atomic_llong*, long long); |
| 1407 | long long atomic_fetch_sub_explicit(volatile atomic_llong*, long long, |
| 1408 | memory_order); |
| 1409 | long long atomic_fetch_sub_explicit(atomic_llong*, long long, memory_order); |
| 1410 | long long atomic_fetch_and(volatile atomic_llong*, long long); |
| 1411 | long long atomic_fetch_and(atomic_llong*, long long); |
| 1412 | long long atomic_fetch_and_explicit(volatile atomic_llong*, long long, |
| 1413 | memory_order); |
| 1414 | long long atomic_fetch_and_explicit(atomic_llong*, long long, memory_order); |
| 1415 | long long atomic_fetch_or(volatile atomic_llong*, long long); |
| 1416 | long long atomic_fetch_or(atomic_llong*, long long); |
| 1417 | long long atomic_fetch_or_explicit(volatile atomic_llong*, long long, |
| 1418 | memory_order); |
| 1419 | long long atomic_fetch_or_explicit(atomic_llong*, long long, memory_order); |
| 1420 | long long atomic_fetch_xor(volatile atomic_llong*, long long); |
| 1421 | long long atomic_fetch_xor(atomic_llong*, long long); |
| 1422 | long long atomic_fetch_xor_explicit(volatile atomic_llong*, long long, |
| 1423 | memory_order); |
| 1424 | long long atomic_fetch_xor_explicit(atomic_llong*, long long, memory_order); |
| 1425 | |
| 1426 | // atomic_ullong |
| 1427 | |
| 1428 | typedef struct atomic_ullong |
| 1429 | { |
| 1430 | bool is_lock_free() const volatile; |
| 1431 | bool is_lock_free() const; |
| 1432 | void store(unsigned long long, |
| 1433 | memory_order = memory_order_seq_cst) volatile; |
| 1434 | void store(unsigned long long, memory_order = memory_order_seq_cst); |
| 1435 | unsigned long long load(memory_order = memory_order_seq_cst) const volatile; |
| 1436 | unsigned long long load(memory_order = memory_order_seq_cst) const; |
| 1437 | operator unsigned long long() const volatile; |
| 1438 | operator unsigned long long() const; |
| 1439 | unsigned long long exchange(unsigned long long, |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1440 | memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1441 | unsigned long long exchange(unsigned long long, |
| 1442 | memory_order = memory_order_seq_cst); |
| 1443 | bool compare_exchange_weak(unsigned long long&, unsigned long long, |
| 1444 | memory_order, memory_order) volatile; |
| 1445 | bool compare_exchange_weak(unsigned long long&, unsigned long long, |
| 1446 | memory_order, memory_order); |
| 1447 | bool compare_exchange_strong(unsigned long long&, unsigned long long, |
| 1448 | memory_order, memory_order) volatile; |
| 1449 | bool compare_exchange_strong(unsigned long long&, unsigned long long, |
| 1450 | memory_order, memory_order); |
| 1451 | bool compare_exchange_weak(unsigned long long&, unsigned long long, |
| 1452 | memory_order = memory_order_seq_cst) volatile; |
| 1453 | bool compare_exchange_weak(unsigned long long&, unsigned long long, |
| 1454 | memory_order = memory_order_seq_cst); |
| 1455 | bool compare_exchange_strong(unsigned long long&, unsigned long long, |
| 1456 | memory_order = memory_order_seq_cst) volatile; |
| 1457 | bool compare_exchange_strong(unsigned long long&, unsigned long long, |
| 1458 | memory_order = memory_order_seq_cst); |
| 1459 | unsigned long long fetch_add(unsigned long long, |
| 1460 | memory_order = memory_order_seq_cst) volatile; |
| 1461 | unsigned long long fetch_add(unsigned long long, |
| 1462 | memory_order = memory_order_seq_cst); |
| 1463 | unsigned long long fetch_sub(unsigned long long, |
| 1464 | memory_order = memory_order_seq_cst) volatile; |
| 1465 | unsigned long long fetch_sub(unsigned long long, |
| 1466 | memory_order = memory_order_seq_cst); |
| 1467 | unsigned long long fetch_and(unsigned long long, |
| 1468 | memory_order = memory_order_seq_cst) volatile; |
| 1469 | unsigned long long fetch_and(unsigned long long, |
| 1470 | memory_order = memory_order_seq_cst); |
| 1471 | unsigned long long fetch_or(unsigned long long, |
| 1472 | memory_order = memory_order_seq_cst) volatile; |
| 1473 | unsigned long long fetch_or(unsigned long long, |
| 1474 | memory_order = memory_order_seq_cst); |
| 1475 | unsigned long long fetch_xor(unsigned long long, |
| 1476 | memory_order = memory_order_seq_cst) volatile; |
| 1477 | unsigned long long fetch_xor(unsigned long long, |
| 1478 | memory_order = memory_order_seq_cst); |
| 1479 | atomic_ullong() = default; |
| 1480 | constexpr atomic_ullong(unsigned long long); |
| 1481 | atomic_ullong(const atomic_ullong&) = delete; |
| 1482 | atomic_ullong& operator=(const atomic_ullong&) = delete; |
| 1483 | atomic_ullong& operator=(const atomic_ullong&) volatile = delete; |
| 1484 | unsigned long long operator=(unsigned long long) volatile; |
| 1485 | unsigned long long operator=(unsigned long long); |
| 1486 | unsigned long long operator++(int) volatile; |
| 1487 | unsigned long long operator++(int); |
| 1488 | unsigned long long operator--(int) volatile; |
| 1489 | unsigned long long operator--(int); |
| 1490 | unsigned long long operator++() volatile; |
| 1491 | unsigned long long operator++(); |
| 1492 | unsigned long long operator--() volatile; |
| 1493 | unsigned long long operator--(); |
| 1494 | unsigned long long operator+=(unsigned long long) volatile; |
| 1495 | unsigned long long operator+=(unsigned long long); |
| 1496 | unsigned long long operator-=(unsigned long long) volatile; |
| 1497 | unsigned long long operator-=(unsigned long long); |
| 1498 | unsigned long long operator&=(unsigned long long) volatile; |
| 1499 | unsigned long long operator&=(unsigned long long); |
| 1500 | unsigned long long operator|=(unsigned long long) volatile; |
| 1501 | unsigned long long operator|=(unsigned long long); |
| 1502 | unsigned long long operator^=(unsigned long long) volatile; |
| 1503 | unsigned long long operator^=(unsigned long long); |
| 1504 | } atomic_ullong; |
| 1505 | |
| 1506 | bool atomic_is_lock_free(const volatile atomic_ullong*); |
| 1507 | bool atomic_is_lock_free(const atomic_ullong*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1508 | void atomic_init(volatile atomic_ullong*, unsigned long long); |
| 1509 | void atomic_init(atomic_ullong*, unsigned long long); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1510 | void atomic_store(volatile atomic_ullong*, unsigned long long); |
| 1511 | void atomic_store(atomic_ullong*, unsigned long long); |
| 1512 | void atomic_store_explicit(volatile atomic_ullong*, unsigned long long, |
| 1513 | memory_order); |
| 1514 | void atomic_store_explicit(atomic_ullong*, unsigned long long, memory_order); |
| 1515 | unsigned long long atomic_load(const volatile atomic_ullong*); |
| 1516 | unsigned long long atomic_load(const atomic_ullong*); |
| 1517 | unsigned long long atomic_load_explicit(const volatile atomic_ullong*, |
| 1518 | memory_order); |
| 1519 | unsigned long long atomic_load_explicit(const atomic_ullong*, memory_order); |
| 1520 | unsigned long long atomic_exchange(volatile atomic_ullong*, unsigned long long); |
| 1521 | unsigned long long atomic_exchange(atomic_ullong*, unsigned long long); |
| 1522 | unsigned long long atomic_exchange_explicit(volatile atomic_ullong*, |
| 1523 | unsigned long long, memory_order); |
| 1524 | unsigned long long atomic_exchange_explicit(atomic_ullong*, unsigned long long, |
| 1525 | memory_order); |
| 1526 | bool atomic_compare_exchange_weak(volatile atomic_ullong*, unsigned long long*, |
| 1527 | unsigned long long); |
| 1528 | bool atomic_compare_exchange_weak(atomic_ullong*, unsigned long long*, |
| 1529 | unsigned long long); |
| 1530 | bool atomic_compare_exchange_strong(volatile atomic_ullong*, |
| 1531 | unsigned long long*, unsigned long long); |
| 1532 | bool atomic_compare_exchange_strong(atomic_ullong*, unsigned long long*, |
| 1533 | unsigned long long); |
| 1534 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ullong*, |
| 1535 | unsigned long long*, |
| 1536 | unsigned long long, memory_order, |
| 1537 | memory_order); |
| 1538 | bool atomic_compare_exchange_weak_explicit(atomic_ullong*, unsigned long long*, |
| 1539 | unsigned long long, memory_order, |
| 1540 | memory_order); |
| 1541 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ullong*, |
| 1542 | unsigned long long*, |
| 1543 | unsigned long long, memory_order, |
| 1544 | memory_order); |
| 1545 | bool atomic_compare_exchange_strong_explicit(atomic_ullong*, |
| 1546 | unsigned long long*, |
| 1547 | unsigned long long, memory_order, |
| 1548 | memory_order); |
| 1549 | unsigned long long atomic_fetch_add(volatile atomic_ullong*, |
| 1550 | unsigned long long); |
| 1551 | unsigned long long atomic_fetch_add(atomic_ullong*, unsigned long long); |
| 1552 | unsigned long long atomic_fetch_add_explicit(volatile atomic_ullong*, |
| 1553 | unsigned long long, memory_order); |
| 1554 | unsigned long long atomic_fetch_add_explicit(atomic_ullong*, unsigned long long, |
| 1555 | memory_order); |
| 1556 | unsigned long long atomic_fetch_sub(volatile atomic_ullong*, |
| 1557 | unsigned long long); |
| 1558 | unsigned long long atomic_fetch_sub(atomic_ullong*, unsigned long long); |
| 1559 | unsigned long long atomic_fetch_sub_explicit(volatile atomic_ullong*, |
| 1560 | unsigned long long, memory_order); |
| 1561 | unsigned long long atomic_fetch_sub_explicit(atomic_ullong*, unsigned long long, |
| 1562 | memory_order); |
| 1563 | unsigned long long atomic_fetch_and(volatile atomic_ullong*, |
| 1564 | unsigned long long); |
| 1565 | unsigned long long atomic_fetch_and(atomic_ullong*, unsigned long long); |
| 1566 | unsigned long long atomic_fetch_and_explicit(volatile atomic_ullong*, |
| 1567 | unsigned long long, memory_order); |
| 1568 | unsigned long long atomic_fetch_and_explicit(atomic_ullong*, unsigned long long, |
| 1569 | memory_order); |
| 1570 | unsigned long long atomic_fetch_or(volatile atomic_ullong*, unsigned long long); |
| 1571 | unsigned long long atomic_fetch_or(atomic_ullong*, unsigned long long); |
| 1572 | unsigned long long atomic_fetch_or_explicit(volatile atomic_ullong*, |
| 1573 | unsigned long long, memory_order); |
| 1574 | unsigned long long atomic_fetch_or_explicit(atomic_ullong*, unsigned long long, |
| 1575 | memory_order); |
| 1576 | unsigned long long atomic_fetch_xor(volatile atomic_ullong*, |
| 1577 | unsigned long long); |
| 1578 | unsigned long long atomic_fetch_xor(atomic_ullong*, unsigned long long); |
| 1579 | unsigned long long atomic_fetch_xor_explicit(volatile atomic_ullong*, |
| 1580 | unsigned long long, memory_order); |
| 1581 | unsigned long long atomic_fetch_xor_explicit(atomic_ullong*, unsigned long long, |
| 1582 | memory_order); |
| 1583 | |
| 1584 | // atomic_char16_t |
| 1585 | |
| 1586 | typedef struct atomic_char16_t |
| 1587 | { |
| 1588 | bool is_lock_free() const volatile; |
| 1589 | bool is_lock_free() const; |
| 1590 | void store(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1591 | void store(char16_t, memory_order = memory_order_seq_cst); |
| 1592 | char16_t load(memory_order = memory_order_seq_cst) const volatile; |
| 1593 | char16_t load(memory_order = memory_order_seq_cst) const; |
| 1594 | operator char16_t() const volatile; |
| 1595 | operator char16_t() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1596 | char16_t exchange(char16_t, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1597 | char16_t exchange(char16_t, memory_order = memory_order_seq_cst); |
| 1598 | bool compare_exchange_weak(char16_t&, char16_t, memory_order, |
| 1599 | memory_order) volatile; |
| 1600 | bool compare_exchange_weak(char16_t&, char16_t, memory_order, memory_order); |
| 1601 | bool compare_exchange_strong(char16_t&, char16_t, memory_order, |
| 1602 | memory_order) volatile; |
| 1603 | bool compare_exchange_strong(char16_t&, char16_t, |
| 1604 | memory_order, memory_order); |
| 1605 | bool compare_exchange_weak(char16_t&, char16_t, |
| 1606 | memory_order = memory_order_seq_cst) volatile; |
| 1607 | bool compare_exchange_weak(char16_t&, char16_t, |
| 1608 | memory_order = memory_order_seq_cst); |
| 1609 | bool compare_exchange_strong(char16_t&, char16_t, |
| 1610 | memory_order = memory_order_seq_cst) volatile; |
| 1611 | bool compare_exchange_strong(char16_t&, char16_t, |
| 1612 | memory_order = memory_order_seq_cst); |
| 1613 | char16_t fetch_add(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1614 | char16_t fetch_add(char16_t, memory_order = memory_order_seq_cst); |
| 1615 | char16_t fetch_sub(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1616 | char16_t fetch_sub(char16_t, memory_order = memory_order_seq_cst); |
| 1617 | char16_t fetch_and(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1618 | char16_t fetch_and(char16_t, memory_order = memory_order_seq_cst); |
| 1619 | char16_t fetch_or(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1620 | char16_t fetch_or(char16_t, memory_order = memory_order_seq_cst); |
| 1621 | char16_t fetch_xor(char16_t, memory_order = memory_order_seq_cst) volatile; |
| 1622 | char16_t fetch_xor(char16_t, memory_order = memory_order_seq_cst); |
| 1623 | atomic_char16_t() = default; |
| 1624 | constexpr atomic_char16_t(char16_t); |
| 1625 | atomic_char16_t(const atomic_char16_t&) = delete; |
| 1626 | atomic_char16_t& operator=(const atomic_char16_t&) = delete; |
| 1627 | atomic_char16_t& operator=(const atomic_char16_t&) volatile = delete; |
| 1628 | char16_t operator=(char16_t) volatile; |
| 1629 | char16_t operator=(char16_t); |
| 1630 | char16_t operator++(int) volatile; |
| 1631 | char16_t operator++(int); |
| 1632 | char16_t operator--(int) volatile; |
| 1633 | char16_t operator--(int); |
| 1634 | char16_t operator++() volatile; |
| 1635 | char16_t operator++(); |
| 1636 | char16_t operator--() volatile; |
| 1637 | char16_t operator--(); |
| 1638 | char16_t operator+=(char16_t) volatile; |
| 1639 | char16_t operator+=(char16_t); |
| 1640 | char16_t operator-=(char16_t) volatile; |
| 1641 | char16_t operator-=(char16_t); |
| 1642 | char16_t operator&=(char16_t) volatile; |
| 1643 | char16_t operator&=(char16_t); |
| 1644 | char16_t operator|=(char16_t) volatile; |
| 1645 | char16_t operator|=(char16_t); |
| 1646 | char16_t operator^=(char16_t) volatile; |
| 1647 | char16_t operator^=(char16_t); |
| 1648 | } atomic_char16_t; |
| 1649 | |
| 1650 | bool atomic_is_lock_free(const volatile atomic_char16_t*); |
| 1651 | bool atomic_is_lock_free(const atomic_char16_t*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1652 | void atomic_init(volatile atomic_char16_t*, char16_t); |
| 1653 | void atomic_init(atomic_char16_t*, char16_t); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1654 | void atomic_store(volatile atomic_char16_t*, char16_t); |
| 1655 | void atomic_store(atomic_char16_t*, char16_t); |
| 1656 | void atomic_store_explicit(volatile atomic_char16_t*, char16_t, memory_order); |
| 1657 | void atomic_store_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1658 | char16_t atomic_load(const volatile atomic_char16_t*); |
| 1659 | char16_t atomic_load(const atomic_char16_t*); |
| 1660 | char16_t atomic_load_explicit(const volatile atomic_char16_t*, memory_order); |
| 1661 | char16_t atomic_load_explicit(const atomic_char16_t*, memory_order); |
| 1662 | char16_t atomic_exchange(volatile atomic_char16_t*, char16_t); |
| 1663 | char16_t atomic_exchange(atomic_char16_t*, char16_t); |
| 1664 | char16_t atomic_exchange_explicit(volatile atomic_char16_t*, char16_t, |
| 1665 | memory_order); |
| 1666 | char16_t atomic_exchange_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1667 | bool atomic_compare_exchange_weak(volatile atomic_char16_t*, char16_t*, |
| 1668 | char16_t); |
| 1669 | bool atomic_compare_exchange_weak(atomic_char16_t*, char16_t*, char16_t); |
| 1670 | bool atomic_compare_exchange_strong(volatile atomic_char16_t*, char16_t*, |
| 1671 | char16_t); |
| 1672 | bool atomic_compare_exchange_strong(atomic_char16_t*, char16_t*, char16_t); |
| 1673 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char16_t*, char16_t*, |
| 1674 | char16_t, memory_order, |
| 1675 | memory_order); |
| 1676 | bool atomic_compare_exchange_weak_explicit(atomic_char16_t*, char16_t*, |
| 1677 | char16_t, memory_order, |
| 1678 | memory_order); |
| 1679 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char16_t*, |
| 1680 | char16_t*, char16_t, memory_order, |
| 1681 | memory_order); |
| 1682 | bool atomic_compare_exchange_strong_explicit(atomic_char16_t*, char16_t*, |
| 1683 | char16_t, memory_order, |
| 1684 | memory_order); |
| 1685 | char16_t atomic_fetch_add(volatile atomic_char16_t*, char16_t); |
| 1686 | char16_t atomic_fetch_add(atomic_char16_t*, char16_t); |
| 1687 | char16_t atomic_fetch_add_explicit(volatile atomic_char16_t*, char16_t, |
| 1688 | memory_order); |
| 1689 | char16_t atomic_fetch_add_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1690 | char16_t atomic_fetch_sub(volatile atomic_char16_t*, char16_t); |
| 1691 | char16_t atomic_fetch_sub(atomic_char16_t*, char16_t); |
| 1692 | char16_t atomic_fetch_sub_explicit(volatile atomic_char16_t*, char16_t, |
| 1693 | memory_order); |
| 1694 | char16_t atomic_fetch_sub_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1695 | char16_t atomic_fetch_and(volatile atomic_char16_t*, char16_t); |
| 1696 | char16_t atomic_fetch_and(atomic_char16_t*, char16_t); |
| 1697 | char16_t atomic_fetch_and_explicit(volatile atomic_char16_t*, char16_t, |
| 1698 | memory_order); |
| 1699 | char16_t atomic_fetch_and_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1700 | char16_t atomic_fetch_or(volatile atomic_char16_t*, char16_t); |
| 1701 | char16_t atomic_fetch_or(atomic_char16_t*, char16_t); |
| 1702 | char16_t atomic_fetch_or_explicit(volatile atomic_char16_t*, char16_t, |
| 1703 | memory_order); |
| 1704 | char16_t atomic_fetch_or_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1705 | char16_t atomic_fetch_xor(volatile atomic_char16_t*, char16_t); |
| 1706 | char16_t atomic_fetch_xor(atomic_char16_t*, char16_t); |
| 1707 | char16_t atomic_fetch_xor_explicit(volatile atomic_char16_t*, char16_t, |
| 1708 | memory_order); |
| 1709 | char16_t atomic_fetch_xor_explicit(atomic_char16_t*, char16_t, memory_order); |
| 1710 | |
| 1711 | // atomic_char32_t |
| 1712 | |
| 1713 | typedef struct atomic_char32_t |
| 1714 | { |
| 1715 | bool is_lock_free() const volatile; |
| 1716 | bool is_lock_free() const; |
| 1717 | void store(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1718 | void store(char32_t, memory_order = memory_order_seq_cst); |
| 1719 | char32_t load(memory_order = memory_order_seq_cst) const volatile; |
| 1720 | char32_t load(memory_order = memory_order_seq_cst) const; |
| 1721 | operator char32_t() const volatile; |
| 1722 | operator char32_t() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1723 | char32_t exchange(char32_t, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1724 | char32_t exchange(char32_t, memory_order = memory_order_seq_cst); |
| 1725 | bool compare_exchange_weak(char32_t&, char32_t, memory_order, |
| 1726 | memory_order) volatile; |
| 1727 | bool compare_exchange_weak(char32_t&, char32_t, memory_order, memory_order); |
| 1728 | bool compare_exchange_strong(char32_t&, char32_t, memory_order, |
| 1729 | memory_order) volatile; |
| 1730 | bool compare_exchange_strong(char32_t&, char32_t, |
| 1731 | memory_order, memory_order); |
| 1732 | bool compare_exchange_weak(char32_t&, char32_t, |
| 1733 | memory_order = memory_order_seq_cst) volatile; |
| 1734 | bool compare_exchange_weak(char32_t&, char32_t, |
| 1735 | memory_order = memory_order_seq_cst); |
| 1736 | bool compare_exchange_strong(char32_t&, char32_t, |
| 1737 | memory_order = memory_order_seq_cst) volatile; |
| 1738 | bool compare_exchange_strong(char32_t&, char32_t, |
| 1739 | memory_order = memory_order_seq_cst); |
| 1740 | char32_t fetch_add(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1741 | char32_t fetch_add(char32_t, memory_order = memory_order_seq_cst); |
| 1742 | char32_t fetch_sub(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1743 | char32_t fetch_sub(char32_t, memory_order = memory_order_seq_cst); |
| 1744 | char32_t fetch_and(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1745 | char32_t fetch_and(char32_t, memory_order = memory_order_seq_cst); |
| 1746 | char32_t fetch_or(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1747 | char32_t fetch_or(char32_t, memory_order = memory_order_seq_cst); |
| 1748 | char32_t fetch_xor(char32_t, memory_order = memory_order_seq_cst) volatile; |
| 1749 | char32_t fetch_xor(char32_t, memory_order = memory_order_seq_cst); |
| 1750 | atomic_char32_t() = default; |
| 1751 | constexpr atomic_char32_t(char32_t); |
| 1752 | atomic_char32_t(const atomic_char32_t&) = delete; |
| 1753 | atomic_char32_t& operator=(const atomic_char32_t&) = delete; |
| 1754 | atomic_char32_t& operator=(const atomic_char32_t&) volatile = delete; |
| 1755 | char32_t operator=(char32_t) volatile; |
| 1756 | char32_t operator=(char32_t); |
| 1757 | char32_t operator++(int) volatile; |
| 1758 | char32_t operator++(int); |
| 1759 | char32_t operator--(int) volatile; |
| 1760 | char32_t operator--(int); |
| 1761 | char32_t operator++() volatile; |
| 1762 | char32_t operator++(); |
| 1763 | char32_t operator--() volatile; |
| 1764 | char32_t operator--(); |
| 1765 | char32_t operator+=(char32_t) volatile; |
| 1766 | char32_t operator+=(char32_t); |
| 1767 | char32_t operator-=(char32_t) volatile; |
| 1768 | char32_t operator-=(char32_t); |
| 1769 | char32_t operator&=(char32_t) volatile; |
| 1770 | char32_t operator&=(char32_t); |
| 1771 | char32_t operator|=(char32_t) volatile; |
| 1772 | char32_t operator|=(char32_t); |
| 1773 | char32_t operator^=(char32_t) volatile; |
| 1774 | char32_t operator^=(char32_t); |
| 1775 | } atomic_char32_t; |
| 1776 | |
| 1777 | bool atomic_is_lock_free(const volatile atomic_char32_t*); |
| 1778 | bool atomic_is_lock_free(const atomic_char32_t*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1779 | void atomic_init(volatile atomic_char32_t*, char32_t); |
| 1780 | void atomic_init(atomic_char32_t*, char32_t); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1781 | void atomic_store(volatile atomic_char32_t*, char32_t); |
| 1782 | void atomic_store(atomic_char32_t*, char32_t); |
| 1783 | void atomic_store_explicit(volatile atomic_char32_t*, char32_t, memory_order); |
| 1784 | void atomic_store_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1785 | char32_t atomic_load(const volatile atomic_char32_t*); |
| 1786 | char32_t atomic_load(const atomic_char32_t*); |
| 1787 | char32_t atomic_load_explicit(const volatile atomic_char32_t*, memory_order); |
| 1788 | char32_t atomic_load_explicit(const atomic_char32_t*, memory_order); |
| 1789 | char32_t atomic_exchange(volatile atomic_char32_t*, char32_t); |
| 1790 | char32_t atomic_exchange(atomic_char32_t*, char32_t); |
| 1791 | char32_t atomic_exchange_explicit(volatile atomic_char32_t*, char32_t, |
| 1792 | memory_order); |
| 1793 | char32_t atomic_exchange_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1794 | bool atomic_compare_exchange_weak(volatile atomic_char32_t*, char32_t*, |
| 1795 | char32_t); |
| 1796 | bool atomic_compare_exchange_weak(atomic_char32_t*, char32_t*, char32_t); |
| 1797 | bool atomic_compare_exchange_strong(volatile atomic_char32_t*, char32_t*, |
| 1798 | char32_t); |
| 1799 | bool atomic_compare_exchange_strong(atomic_char32_t*, char32_t*, char32_t); |
| 1800 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char32_t*, char32_t*, |
| 1801 | char32_t, memory_order, |
| 1802 | memory_order); |
| 1803 | bool atomic_compare_exchange_weak_explicit(atomic_char32_t*, char32_t*, |
| 1804 | char32_t, memory_order, |
| 1805 | memory_order); |
| 1806 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char32_t*, |
| 1807 | char32_t*, char32_t, memory_order, |
| 1808 | memory_order); |
| 1809 | bool atomic_compare_exchange_strong_explicit(atomic_char32_t*, char32_t*, |
| 1810 | char32_t, memory_order, |
| 1811 | memory_order); |
| 1812 | char32_t atomic_fetch_add(volatile atomic_char32_t*, char32_t); |
| 1813 | char32_t atomic_fetch_add(atomic_char32_t*, char32_t); |
| 1814 | char32_t atomic_fetch_add_explicit(volatile atomic_char32_t*, char32_t, |
| 1815 | memory_order); |
| 1816 | char32_t atomic_fetch_add_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1817 | char32_t atomic_fetch_sub(volatile atomic_char32_t*, char32_t); |
| 1818 | char32_t atomic_fetch_sub(atomic_char32_t*, char32_t); |
| 1819 | char32_t atomic_fetch_sub_explicit(volatile atomic_char32_t*, char32_t, |
| 1820 | memory_order); |
| 1821 | char32_t atomic_fetch_sub_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1822 | char32_t atomic_fetch_and(volatile atomic_char32_t*, char32_t); |
| 1823 | char32_t atomic_fetch_and(atomic_char32_t*, char32_t); |
| 1824 | char32_t atomic_fetch_and_explicit(volatile atomic_char32_t*, char32_t, |
| 1825 | memory_order); |
| 1826 | char32_t atomic_fetch_and_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1827 | char32_t atomic_fetch_or(volatile atomic_char32_t*, char32_t); |
| 1828 | char32_t atomic_fetch_or(atomic_char32_t*, char32_t); |
| 1829 | char32_t atomic_fetch_or_explicit(volatile atomic_char32_t*, char32_t, |
| 1830 | memory_order); |
| 1831 | char32_t atomic_fetch_or_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1832 | char32_t atomic_fetch_xor(volatile atomic_char32_t*, char32_t); |
| 1833 | char32_t atomic_fetch_xor(atomic_char32_t*, char32_t); |
| 1834 | char32_t atomic_fetch_xor_explicit(volatile atomic_char32_t*, char32_t, |
| 1835 | memory_order); |
| 1836 | char32_t atomic_fetch_xor_explicit(atomic_char32_t*, char32_t, memory_order); |
| 1837 | |
| 1838 | // atomic_wchar_t |
| 1839 | |
| 1840 | typedef struct atomic_wchar_t |
| 1841 | { |
| 1842 | bool is_lock_free() const volatile; |
| 1843 | bool is_lock_free() const; |
| 1844 | void store(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1845 | void store(wchar_t, memory_order = memory_order_seq_cst); |
| 1846 | wchar_t load(memory_order = memory_order_seq_cst) const volatile; |
| 1847 | wchar_t load(memory_order = memory_order_seq_cst) const; |
| 1848 | operator wchar_t() const volatile; |
| 1849 | operator wchar_t() const; |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1850 | wchar_t exchange(wchar_t, memory_order = memory_order_seq_cst) volatile; |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1851 | wchar_t exchange(wchar_t, memory_order = memory_order_seq_cst); |
| 1852 | bool compare_exchange_weak(wchar_t&, wchar_t, memory_order, |
| 1853 | memory_order) volatile; |
| 1854 | bool compare_exchange_weak(wchar_t&, wchar_t, memory_order, memory_order); |
| 1855 | bool compare_exchange_strong(wchar_t&, wchar_t, memory_order, |
| 1856 | memory_order) volatile; |
| 1857 | bool compare_exchange_strong(wchar_t&, wchar_t, memory_order, memory_order); |
| 1858 | bool compare_exchange_weak(wchar_t&, wchar_t, |
| 1859 | memory_order = memory_order_seq_cst) volatile; |
| 1860 | bool compare_exchange_weak(wchar_t&, wchar_t, |
| 1861 | memory_order = memory_order_seq_cst); |
| 1862 | bool compare_exchange_strong(wchar_t&, wchar_t, |
| 1863 | memory_order = memory_order_seq_cst) volatile; |
| 1864 | bool compare_exchange_strong(wchar_t&, wchar_t, |
| 1865 | memory_order = memory_order_seq_cst); |
| 1866 | wchar_t fetch_add(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1867 | wchar_t fetch_add(wchar_t, memory_order = memory_order_seq_cst); |
| 1868 | wchar_t fetch_sub(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1869 | wchar_t fetch_sub(wchar_t, memory_order = memory_order_seq_cst); |
| 1870 | wchar_t fetch_and(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1871 | wchar_t fetch_and(wchar_t, memory_order = memory_order_seq_cst); |
| 1872 | wchar_t fetch_or(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1873 | wchar_t fetch_or(wchar_t, memory_order = memory_order_seq_cst); |
| 1874 | wchar_t fetch_xor(wchar_t, memory_order = memory_order_seq_cst) volatile; |
| 1875 | wchar_t fetch_xor(wchar_t, memory_order = memory_order_seq_cst); |
| 1876 | atomic_wchar_t() = default; |
| 1877 | constexpr atomic_wchar_t(wchar_t); |
| 1878 | atomic_wchar_t(const atomic_wchar_t&) = delete; |
| 1879 | atomic_wchar_t& operator=(const atomic_wchar_t&) = delete; |
| 1880 | atomic_wchar_t& operator=(const atomic_wchar_t&) volatile = delete; |
| 1881 | wchar_t operator=(wchar_t) volatile; |
| 1882 | wchar_t operator=(wchar_t); |
| 1883 | wchar_t operator++(int) volatile; |
| 1884 | wchar_t operator++(int); |
| 1885 | wchar_t operator--(int) volatile; |
| 1886 | wchar_t operator--(int); |
| 1887 | wchar_t operator++() volatile; |
| 1888 | wchar_t operator++(); |
| 1889 | wchar_t operator--() volatile; |
| 1890 | wchar_t operator--(); |
| 1891 | wchar_t operator+=(wchar_t) volatile; |
| 1892 | wchar_t operator+=(wchar_t); |
| 1893 | wchar_t operator-=(wchar_t) volatile; |
| 1894 | wchar_t operator-=(wchar_t); |
| 1895 | wchar_t operator&=(wchar_t) volatile; |
| 1896 | wchar_t operator&=(wchar_t); |
| 1897 | wchar_t operator|=(wchar_t) volatile; |
| 1898 | wchar_t operator|=(wchar_t); |
| 1899 | wchar_t operator^=(wchar_t) volatile; |
| 1900 | wchar_t operator^=(wchar_t); |
| 1901 | } atomic_wchar_t; |
| 1902 | |
| 1903 | bool atomic_is_lock_free(const volatile atomic_wchar_t*); |
| 1904 | bool atomic_is_lock_free(const atomic_wchar_t*); |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 1905 | void atomic_init(volatile atomic_wchar_t*, wchar_t); |
| 1906 | void atomic_init(atomic_wchar_t*, wchar_t); |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 1907 | void atomic_store(volatile atomic_wchar_t*, wchar_t); |
| 1908 | void atomic_store(atomic_wchar_t*, wchar_t); |
| 1909 | void atomic_store_explicit(volatile atomic_wchar_t*, wchar_t, memory_order); |
| 1910 | void atomic_store_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1911 | wchar_t atomic_load(const volatile atomic_wchar_t*); |
| 1912 | wchar_t atomic_load(const atomic_wchar_t*); |
| 1913 | wchar_t atomic_load_explicit(const volatile atomic_wchar_t*, memory_order); |
| 1914 | wchar_t atomic_load_explicit(const atomic_wchar_t*, memory_order); |
| 1915 | wchar_t atomic_exchange(volatile atomic_wchar_t*, wchar_t); |
| 1916 | wchar_t atomic_exchange(atomic_wchar_t*, wchar_t); |
| 1917 | wchar_t atomic_exchange_explicit(volatile atomic_wchar_t*, |
| 1918 | wchar_t, memory_order); |
| 1919 | wchar_t atomic_exchange_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1920 | bool atomic_compare_exchange_weak(volatile atomic_wchar_t*, wchar_t*, wchar_t); |
| 1921 | bool atomic_compare_exchange_weak(atomic_wchar_t*, wchar_t*, wchar_t); |
| 1922 | bool atomic_compare_exchange_strong(volatile atomic_wchar_t*, wchar_t*, |
| 1923 | wchar_t); |
| 1924 | bool atomic_compare_exchange_strong(atomic_wchar_t*, wchar_t*, wchar_t); |
| 1925 | bool atomic_compare_exchange_weak_explicit(volatile atomic_wchar_t*, wchar_t*, |
| 1926 | wchar_t, memory_order, memory_order); |
| 1927 | bool atomic_compare_exchange_weak_explicit(atomic_wchar_t*, wchar_t*, wchar_t, |
| 1928 | memory_order, memory_order); |
| 1929 | bool atomic_compare_exchange_strong_explicit(volatile atomic_wchar_t*, wchar_t*, |
| 1930 | wchar_t, memory_order, |
| 1931 | memory_order); |
| 1932 | bool atomic_compare_exchange_strong_explicit(atomic_wchar_t*, wchar_t*, wchar_t, |
| 1933 | memory_order, memory_order); |
| 1934 | wchar_t atomic_fetch_add(volatile atomic_wchar_t*, wchar_t); |
| 1935 | wchar_t atomic_fetch_add(atomic_wchar_t*, wchar_t); |
| 1936 | wchar_t atomic_fetch_add_explicit(volatile atomic_wchar_t*, wchar_t, |
| 1937 | memory_order); |
| 1938 | wchar_t atomic_fetch_add_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1939 | wchar_t atomic_fetch_sub(volatile atomic_wchar_t*, wchar_t); |
| 1940 | wchar_t atomic_fetch_sub(atomic_wchar_t*, wchar_t); |
| 1941 | wchar_t atomic_fetch_sub_explicit(volatile atomic_wchar_t*, wchar_t, |
| 1942 | memory_order); |
| 1943 | wchar_t atomic_fetch_sub_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1944 | wchar_t atomic_fetch_and(volatile atomic_wchar_t*, wchar_t); |
| 1945 | wchar_t atomic_fetch_and(atomic_wchar_t*, wchar_t); |
| 1946 | wchar_t atomic_fetch_and_explicit(volatile atomic_wchar_t*, wchar_t, |
| 1947 | memory_order); |
| 1948 | wchar_t atomic_fetch_and_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1949 | wchar_t atomic_fetch_or(volatile atomic_wchar_t*, wchar_t); |
| 1950 | wchar_t atomic_fetch_or(atomic_wchar_t*, wchar_t); |
| 1951 | wchar_t atomic_fetch_or_explicit(volatile atomic_wchar_t*, wchar_t, |
| 1952 | memory_order); |
| 1953 | wchar_t atomic_fetch_or_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1954 | wchar_t atomic_fetch_xor(volatile atomic_wchar_t*, wchar_t); |
| 1955 | wchar_t atomic_fetch_xor(atomic_wchar_t*, wchar_t); |
| 1956 | wchar_t atomic_fetch_xor_explicit(volatile atomic_wchar_t*, wchar_t, |
| 1957 | memory_order); |
| 1958 | wchar_t atomic_fetch_xor_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 1959 | |
| 1960 | // Atomics for standard typedef types |
| 1961 | |
| 1962 | typedef atomic_schar atomic_int_least8_t; |
| 1963 | typedef atomic_uchar atomic_uint_least8_t; |
| 1964 | typedef atomic_short atomic_int_least16_t; |
| 1965 | typedef atomic_ushort atomic_uint_least16_t; |
| 1966 | typedef atomic_int atomic_int_least32_t; |
| 1967 | typedef atomic_uint atomic_uint_least32_t; |
| 1968 | typedef atomic_llong atomic_int_least64_t; |
| 1969 | typedef atomic_ullong atomic_uint_least64_t; |
| 1970 | |
| 1971 | typedef atomic_schar atomic_int_fast8_t; |
| 1972 | typedef atomic_uchar atomic_uint_fast8_t; |
| 1973 | typedef atomic_short atomic_int_fast16_t; |
| 1974 | typedef atomic_ushort atomic_uint_fast16_t; |
| 1975 | typedef atomic_int atomic_int_fast32_t; |
| 1976 | typedef atomic_uint atomic_uint_fast32_t; |
| 1977 | typedef atomic_llong atomic_int_fast64_t; |
| 1978 | typedef atomic_ullong atomic_uint_fast64_t; |
| 1979 | |
| 1980 | typedef atomic_long atomic_intptr_t; |
| 1981 | typedef atomic_ulong atomic_uintptr_t; |
| 1982 | typedef atomic_ulong atomic_size_t; |
| 1983 | typedef atomic_long atomic_ptrdiff_t; |
| 1984 | typedef atomic_llong atomic_intmax_t; |
| 1985 | typedef atomic_ullong atomic_uintmax_t; |
| 1986 | |
| 1987 | // address types |
| 1988 | |
| 1989 | typedef struct atomic_address |
| 1990 | { |
| 1991 | bool is_lock_free() const volatile; |
| 1992 | bool is_lock_free() const; |
| 1993 | void store(void*, memory_order = memory_order_seq_cst) volatile; |
| 1994 | void store(void*, memory_order = memory_order_seq_cst); |
| 1995 | void* load(memory_order = memory_order_seq_cst) const volatile; |
| 1996 | void* load(memory_order = memory_order_seq_cst) const; |
| 1997 | operator void*() const volatile; |
| 1998 | operator void*() const; |
| 1999 | void* exchange(void*, memory_order = memory_order_seq_cst) volatile; |
| 2000 | void* exchange(void*, memory_order = memory_order_seq_cst); |
| 2001 | bool compare_exchange_weak(void*&, void*, memory_order, |
| 2002 | memory_order) volatile; |
| 2003 | bool compare_exchange_weak(void*&, void*, memory_order, memory_order); |
| 2004 | bool compare_exchange_strong(void*&, void*, memory_order, |
| 2005 | memory_order) volatile; |
| 2006 | bool compare_exchange_strong(void*&, void*, memory_order, memory_order); |
| 2007 | bool compare_exchange_weak(void*&, void*, |
| 2008 | memory_order = memory_order_seq_cst) volatile; |
| 2009 | bool compare_exchange_weak(void*&, void*, |
| 2010 | memory_order = memory_order_seq_cst); |
| 2011 | bool compare_exchange_strong(void*&, void*, |
| 2012 | memory_order = memory_order_seq_cst) volatile; |
| 2013 | bool compare_exchange_strong(void*&, void*, |
| 2014 | memory_order = memory_order_seq_cst); |
| 2015 | bool compare_exchange_weak(const void*&, const void*, |
| 2016 | memory_order, memory_order) volatile; |
| 2017 | bool compare_exchange_weak(const void*&, const void*, memory_order, |
| 2018 | memory_order); |
| 2019 | bool compare_exchange_strong(const void*&, const void*, memory_order, |
| 2020 | memory_order) volatile; |
| 2021 | bool compare_exchange_strong(const void*&, const void*, memory_order, |
| 2022 | memory_order); |
| 2023 | bool compare_exchange_weak(const void*&, const void*, |
| 2024 | memory_order = memory_order_seq_cst) volatile; |
| 2025 | bool compare_exchange_weak(const void*&, const void*, |
| 2026 | memory_order = memory_order_seq_cst); |
| 2027 | bool compare_exchange_strong(const void*&, const void*, |
| 2028 | memory_order = memory_order_seq_cst) volatile; |
| 2029 | bool compare_exchange_strong(const void*&, const void*, |
| 2030 | memory_order = memory_order_seq_cst); |
| 2031 | void* fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile; |
| 2032 | void* fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst); |
| 2033 | void* fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile; |
| 2034 | void* fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst); |
| 2035 | atomic_address() = default; |
| 2036 | constexpr atomic_address(void*); |
| 2037 | atomic_address(const atomic_address&) = delete; |
| 2038 | atomic_address& operator=(const atomic_address&) = delete; |
| 2039 | atomic_address& operator=(const atomic_address&) volatile = delete; |
| 2040 | void* operator=(const void*) volatile; |
| 2041 | void* operator=(const void*); |
| 2042 | void* operator+=(ptrdiff_t) volatile; |
| 2043 | void* operator+=(ptrdiff_t); |
| 2044 | void* operator-=(ptrdiff_t) volatile; |
| 2045 | void* operator-=(ptrdiff_t); |
| 2046 | } atomic_address; |
| 2047 | |
| 2048 | bool atomic_is_lock_free(const volatile atomic_address*); |
| 2049 | bool atomic_is_lock_free(const atomic_address*); |
| 2050 | void atomic_init(volatile atomic_address*, void*); |
| 2051 | void atomic_init(atomic_address*, void*); |
| 2052 | void atomic_store(volatile atomic_address*, void*); |
| 2053 | void atomic_store(atomic_address*, void*); |
| 2054 | void atomic_store_explicit(volatile atomic_address*, void*, memory_order); |
| 2055 | void atomic_store_explicit(atomic_address*, void*, memory_order); |
| 2056 | void* atomic_load(const volatile atomic_address*); |
| 2057 | void* atomic_load(const atomic_address*); |
| 2058 | void* atomic_load_explicit(const volatile atomic_address*, memory_order); |
| 2059 | void* atomic_load_explicit(const atomic_address*, memory_order); |
| 2060 | void* atomic_exchange(volatile atomic_address*, void*); |
| 2061 | void* atomic_exchange(atomic_address*, void*); |
| 2062 | void* atomic_exchange_explicit(volatile atomic_address*, void*, memory_order); |
| 2063 | void* atomic_exchange_explicit(atomic_address*, void*, memory_order); |
| 2064 | bool atomic_compare_exchange_weak(volatile atomic_address*, void**, void*); |
| 2065 | bool atomic_compare_exchange_weak(atomic_address*, void**, void*); |
| 2066 | bool atomic_compare_exchange_strong(volatile atomic_address*, void**, void*); |
| 2067 | bool atomic_compare_exchange_strong(atomic_address*, void**, void*); |
| 2068 | bool atomic_compare_exchange_weak_explicit(volatile atomic_address*, void**, |
| 2069 | void*, memory_order, memory_order); |
| 2070 | bool atomic_compare_exchange_weak_explicit(atomic_address*, void**, void*, |
| 2071 | memory_order, memory_order); |
| 2072 | bool atomic_compare_exchange_strong_explicit(volatile atomic_address*, void**, |
| 2073 | void*, memory_order, memory_order); |
| 2074 | bool atomic_compare_exchange_strong_explicit(atomic_address*, void**, void*, |
| 2075 | memory_order, memory_order); |
| 2076 | void* atomic_fetch_add(volatile atomic_address*, ptrdiff_t); |
| 2077 | void* atomic_fetch_add(atomic_address*, ptrdiff_t); |
| 2078 | void* atomic_fetch_add_explicit(volatile atomic_address*, ptrdiff_t, |
| 2079 | memory_order); |
| 2080 | void* atomic_fetch_add_explicit(atomic_address*, ptrdiff_t, memory_order); |
| 2081 | void* atomic_fetch_sub(volatile atomic_address*, ptrdiff_t); |
| 2082 | void* atomic_fetch_sub(atomic_address*, ptrdiff_t); |
| 2083 | void* atomic_fetch_sub_explicit(volatile atomic_address*, ptrdiff_t, |
| 2084 | memory_order); |
| 2085 | void* atomic_fetch_sub_explicit(atomic_address*, ptrdiff_t, memory_order); |
| 2086 | |
| 2087 | // generic types |
| 2088 | |
| 2089 | template <class T> |
| 2090 | struct atomic |
| 2091 | { |
| 2092 | bool is_lock_free() const volatile; |
| 2093 | bool is_lock_free() const; |
| 2094 | void store(T, memory_order = memory_order_seq_cst) volatile; |
| 2095 | void store(T, memory_order = memory_order_seq_cst); |
| 2096 | T load(memory_order = memory_order_seq_cst) const volatile; |
| 2097 | T load(memory_order = memory_order_seq_cst) const; |
| 2098 | operator T() const volatile; |
| 2099 | operator T() const; |
| 2100 | T exchange(T, memory_order = memory_order_seq_cst) volatile; |
| 2101 | T exchange(T, memory_order = memory_order_seq_cst); |
| 2102 | bool compare_exchange_weak(T&, T, memory_order, memory_order) volatile; |
| 2103 | bool compare_exchange_weak(T&, T, memory_order, memory_order); |
| 2104 | bool compare_exchange_strong(T&, T, memory_order, memory_order) volatile; |
| 2105 | bool compare_exchange_strong(T&, T, memory_order, memory_order); |
| 2106 | bool compare_exchange_weak(T&, T, |
| 2107 | memory_order = memory_order_seq_cst) volatile; |
| 2108 | bool compare_exchange_weak(T&, T, memory_order = memory_order_seq_cst); |
| 2109 | bool compare_exchange_strong(T&, T, |
| 2110 | memory_order = memory_order_seq_cst) volatile; |
| 2111 | bool compare_exchange_strong(T&, T, memory_order = memory_order_seq_cst); |
| 2112 | |
| 2113 | atomic() = default; |
| 2114 | constexpr atomic(T); |
| 2115 | atomic(const atomic&) = delete; |
| 2116 | atomic& operator=(const atomic&) = delete; |
| 2117 | atomic& operator=(const atomic&) volatile = delete; |
| 2118 | T operator=(T) volatile; |
| 2119 | T operator=(T); |
| 2120 | }; |
| 2121 | |
| 2122 | template <> |
| 2123 | struct atomic<bool> |
| 2124 | : public atomic_bool |
| 2125 | { |
| 2126 | atomic() = default; |
| 2127 | constexpr atomic(bool); |
| 2128 | atomic(const atomic&) = delete; |
| 2129 | atomic& operator=(const atomic&) = delete; |
| 2130 | atomic& operator=(const atomic&) volatile = delete; |
| 2131 | bool operator=(bool) volatile; |
| 2132 | bool operator=(bool); |
| 2133 | operator bool() const volatile; |
| 2134 | operator bool() const; |
| 2135 | }; |
| 2136 | |
| 2137 | template <> |
| 2138 | struct atomic<char> |
| 2139 | : public atomic_char |
| 2140 | { |
| 2141 | atomic() = default; |
| 2142 | constexpr atomic(char); |
| 2143 | atomic(const atomic&) = delete; |
| 2144 | atomic& operator=(const atomic&) = delete; |
| 2145 | atomic& operator=(const atomic&) volatile = delete; |
| 2146 | char operator=(char) volatile; |
| 2147 | char operator=(char); |
| 2148 | operator char() const volatile; |
| 2149 | operator char() const; |
| 2150 | }; |
| 2151 | |
| 2152 | template <> |
| 2153 | struct atomic<signed char> |
| 2154 | : public atomic_schar |
| 2155 | { |
| 2156 | atomic() = default; |
| 2157 | constexpr atomic(signed char); |
| 2158 | atomic(const atomic&) = delete; |
| 2159 | atomic& operator=(const atomic&) = delete; |
| 2160 | atomic& operator=(const atomic&) volatile = delete; |
| 2161 | signed char operator=(signed char) volatile; |
| 2162 | signed char operator=(signed char); |
| 2163 | operator signed char() const volatile; |
| 2164 | operator signed char() const; |
| 2165 | }; |
| 2166 | |
| 2167 | template <> |
| 2168 | struct atomic<unsigned char> |
| 2169 | : public atomic_uchar |
| 2170 | { |
| 2171 | atomic() = default; |
| 2172 | constexpr atomic(unsigned char); |
| 2173 | atomic(const atomic&) = delete; |
| 2174 | atomic& operator=(const atomic&) = delete; |
| 2175 | atomic& operator=(const atomic&) volatile = delete; |
| 2176 | unsigned char operator=(unsigned char) volatile; |
| 2177 | unsigned char operator=(unsigned char); |
| 2178 | operator unsigned char() const volatile; |
| 2179 | operator unsigned char() const; |
| 2180 | }; |
| 2181 | |
| 2182 | template <> |
| 2183 | struct atomic<short> |
| 2184 | : public atomic_short |
| 2185 | { |
| 2186 | atomic() = default; |
| 2187 | constexpr atomic(short); |
| 2188 | atomic(const atomic&) = delete; |
| 2189 | atomic& operator=(const atomic&) = delete; |
| 2190 | atomic& operator=(const atomic&) volatile = delete; |
| 2191 | short operator=(short) volatile; |
| 2192 | short operator=(short); |
| 2193 | operator short() const volatile; |
| 2194 | operator short() const; |
| 2195 | }; |
| 2196 | |
| 2197 | template <> |
| 2198 | struct atomic<unsigned short> |
| 2199 | : public atomic_ushort |
| 2200 | { |
| 2201 | atomic() = default; |
| 2202 | constexpr atomic(unsigned short); |
| 2203 | atomic(const atomic&) = delete; |
| 2204 | atomic& operator=(const atomic&) = delete; |
| 2205 | atomic& operator=(const atomic&) volatile = delete; |
| 2206 | unsigned short operator=(unsigned short) volatile; |
| 2207 | unsigned short operator=(unsigned short); |
| 2208 | operator unsigned short() const volatile; |
| 2209 | operator unsigned short() const; |
| 2210 | }; |
| 2211 | |
| 2212 | template <> |
| 2213 | struct atomic<int> |
| 2214 | : public atomic_int |
| 2215 | { |
| 2216 | atomic() = default; |
| 2217 | constexpr atomic(int); |
| 2218 | atomic(const atomic&) = delete; |
| 2219 | atomic& operator=(const atomic&) = delete; |
| 2220 | atomic& operator=(const atomic&) volatile = delete; |
| 2221 | int operator=(int) volatile; |
| 2222 | int operator=(int); |
| 2223 | operator int() const volatile; |
| 2224 | operator int() const; |
| 2225 | }; |
| 2226 | |
| 2227 | template <> |
| 2228 | struct atomic<unsigned int> |
| 2229 | : public atomic_uint |
| 2230 | { |
| 2231 | atomic() = default; |
| 2232 | constexpr atomic(unsigned int); |
| 2233 | atomic(const atomic&) = delete; |
| 2234 | atomic& operator=(const atomic&) = delete; |
| 2235 | atomic& operator=(const atomic&) volatile = delete; |
| 2236 | unsigned int operator=(unsigned int) volatile; |
| 2237 | unsigned int operator=(unsigned int); |
| 2238 | operator unsigned int() const volatile; |
| 2239 | operator unsigned int() const; |
| 2240 | }; |
| 2241 | |
| 2242 | template <> |
| 2243 | struct atomic<long> |
| 2244 | : public atomic_long |
| 2245 | { |
| 2246 | atomic() = default; |
| 2247 | constexpr atomic(long); |
| 2248 | atomic(const atomic&) = delete; |
| 2249 | atomic& operator=(const atomic&) = delete; |
| 2250 | atomic& operator=(const atomic&) volatile = delete; |
| 2251 | long operator=(long) volatile; |
| 2252 | long operator=(long); |
| 2253 | operator long() const volatile; |
| 2254 | operator long() const; |
| 2255 | }; |
| 2256 | |
| 2257 | template <> |
| 2258 | struct atomic<unsigned long> |
| 2259 | : public atomic_ulong |
| 2260 | { |
| 2261 | atomic() = default; |
| 2262 | constexpr atomic(unsigned long); |
| 2263 | atomic(const atomic&) = delete; |
| 2264 | atomic& operator=(const atomic&) = delete; |
| 2265 | atomic& operator=(const atomic&) volatile = delete; |
| 2266 | unsigned long operator=(unsigned long) volatile; |
| 2267 | unsigned long operator=(unsigned long); |
| 2268 | operator unsigned long() const volatile; |
| 2269 | operator unsigned long() const; |
| 2270 | }; |
| 2271 | |
| 2272 | template <> |
| 2273 | struct atomic<long long> |
| 2274 | : public atomic_llong |
| 2275 | { |
| 2276 | atomic() = default; |
| 2277 | constexpr atomic(long long); |
| 2278 | atomic(const atomic&) = delete; |
| 2279 | atomic& operator=(const atomic&) = delete; |
| 2280 | atomic& operator=(const atomic&) volatile = delete; |
| 2281 | long long operator=(long long) volatile; |
| 2282 | long long operator=(long long); |
| 2283 | operator long long() const volatile; |
| 2284 | operator long long() const; |
| 2285 | }; |
| 2286 | |
| 2287 | template <> |
| 2288 | struct atomic<unsigned long long> |
| 2289 | : public atomic_ullong |
| 2290 | { |
| 2291 | atomic() = default; |
| 2292 | constexpr atomic(unsigned long long); |
| 2293 | atomic(const atomic&) = delete; |
| 2294 | atomic& operator=(const atomic&) = delete; |
| 2295 | atomic& operator=(const atomic&) volatile = delete; |
| 2296 | unsigned long long operator=(unsigned long long) volatile; |
| 2297 | unsigned long long operator=(unsigned long long); |
| 2298 | operator unsigned long long() const volatile; |
| 2299 | operator unsigned long long() const; |
| 2300 | }; |
| 2301 | |
| 2302 | template <> |
| 2303 | struct atomic<char16_t> |
| 2304 | : public atomic_char16_t |
| 2305 | { |
| 2306 | atomic() = default; |
| 2307 | constexpr atomic(char16_t); |
| 2308 | atomic(const atomic&) = delete; |
| 2309 | atomic& operator=(const atomic&) = delete; |
| 2310 | atomic& operator=(const atomic&) volatile = delete; |
| 2311 | char16_t operator=(char16_t) volatile; |
| 2312 | char16_t operator=(char16_t); |
| 2313 | operator char16_t() const volatile; |
| 2314 | operator char16_t() const; |
| 2315 | }; |
| 2316 | |
| 2317 | template <> |
| 2318 | struct atomic<char32_t> |
| 2319 | : public atomic_char32_t |
| 2320 | { |
| 2321 | atomic() = default; |
| 2322 | constexpr atomic(char32_t); |
| 2323 | atomic(const atomic&) = delete; |
| 2324 | atomic& operator=(const atomic&) = delete; |
| 2325 | atomic& operator=(const atomic&) volatile = delete; |
| 2326 | char32_t operator=(char32_t) volatile; |
| 2327 | char32_t operator=(char32_t); |
| 2328 | operator char32_t() const volatile; |
| 2329 | operator char32_t() const; |
| 2330 | }; |
| 2331 | |
| 2332 | template <> |
| 2333 | struct atomic<wchar_t> |
| 2334 | : public atomic_wchar_t |
| 2335 | { |
| 2336 | atomic() = default; |
| 2337 | constexpr atomic(wchar_t); |
| 2338 | atomic(const atomic&) = delete; |
| 2339 | atomic& operator=(const atomic&) = delete; |
| 2340 | atomic& operator=(const atomic&) volatile = delete; |
| 2341 | wchar_t operator=(wchar_t) volatile; |
| 2342 | wchar_t operator=(wchar_t); |
| 2343 | operator wchar_t() const volatile; |
| 2344 | operator wchar_t() const; |
| 2345 | }; |
| 2346 | |
| 2347 | template <class T> |
| 2348 | struct atomic<T*> |
| 2349 | : public atomic_address |
| 2350 | { |
| 2351 | void store(T*, memory_order = memory_order_seq_cst) volatile; |
| 2352 | void store(T*, memory_order = memory_order_seq_cst); |
| 2353 | T* load(memory_order = memory_order_seq_cst) const volatile; |
| 2354 | T* load(memory_order = memory_order_seq_cst) const; |
| 2355 | operator T*() const volatile; |
| 2356 | operator T*() const; |
| 2357 | T* exchange(T*, memory_order = memory_order_seq_cst) volatile; |
| 2358 | T* exchange(T*, memory_order = memory_order_seq_cst); |
| 2359 | bool compare_exchange_weak(T*&, T*, memory_order, memory_order) volatile; |
| 2360 | bool compare_exchange_weak(T*&, T*, memory_order, memory_order); |
| 2361 | bool compare_exchange_strong(T*&, T*, memory_order, memory_order) volatile; |
| 2362 | bool compare_exchange_strong(T*&, T*, memory_order, memory_order); |
| 2363 | bool compare_exchange_weak(T*&, T*, |
| 2364 | memory_order = memory_order_seq_cst) volatile; |
| 2365 | bool compare_exchange_weak(T*&, T*, memory_order = memory_order_seq_cst); |
| 2366 | bool compare_exchange_strong(T*&, T*, |
| 2367 | memory_order = memory_order_seq_cst) volatile; |
| 2368 | bool compare_exchange_strong(T*&, T*, memory_order = memory_order_seq_cst); |
| 2369 | T* fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile; |
| 2370 | T* fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst); |
| 2371 | T* fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile; |
| 2372 | T* fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst); |
| 2373 | atomic() = default; |
| 2374 | constexpr atomic(T*); |
| 2375 | atomic(const atomic&) = delete; |
| 2376 | atomic& operator=(const atomic&) = delete; |
| 2377 | atomic& operator=(const atomic&) volatile = delete; |
| 2378 | T* operator=(T*) volatile; |
| 2379 | T* operator=(T*); |
| 2380 | T* operator++(int) volatile; |
| 2381 | T* operator++(int); |
| 2382 | T* operator--(int) volatile; |
| 2383 | T* operator--(int); |
| 2384 | T* operator++() volatile; |
| 2385 | T* operator++(); |
| 2386 | T* operator--() volatile; |
| 2387 | T* operator--(); |
| 2388 | T* operator+=(ptrdiff_t) volatile; |
| 2389 | T* operator+=(ptrdiff_t); |
| 2390 | T* operator-=(ptrdiff_t) volatile; |
| 2391 | T* operator-=(ptrdiff_t); |
| 2392 | }; |
| 2393 | |
| 2394 | // fences |
| 2395 | |
| 2396 | void atomic_thread_fence(memory_order); |
| 2397 | void atomic_signal_fence(memory_order); |
| 2398 | |
| 2399 | } // std |
| 2400 | |
| 2401 | */ |
| 2402 | |
| 2403 | #include <__config> |
| 2404 | |
| 2405 | #pragma GCC system_header |
| 2406 | |
| 2407 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 2408 | |
Howard Hinnant | d1176e2 | 2010-09-28 17:13:38 +0000 | [diff] [blame] | 2409 | typedef enum memory_order |
| 2410 | { |
| 2411 | memory_order_relaxed, memory_order_consume, memory_order_acquire, |
| 2412 | memory_order_release, memory_order_acq_rel, memory_order_seq_cst |
| 2413 | } memory_order; |
| 2414 | |
| 2415 | template <class _Tp> |
| 2416 | inline _LIBCPP_INLINE_VISIBILITY |
| 2417 | _Tp |
| 2418 | kill_dependency(_Tp __y) |
| 2419 | { |
| 2420 | return __y; |
| 2421 | } |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 2422 | |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2423 | // flag type and operations |
| 2424 | |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2425 | typedef bool __atomic_flag__; |
Howard Hinnant | 6cac2c2 | 2010-10-05 14:02:23 +0000 | [diff] [blame] | 2426 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2427 | struct atomic_flag; |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2428 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2429 | bool atomic_flag_test_and_set(volatile atomic_flag*); |
| 2430 | bool atomic_flag_test_and_set(atomic_flag*); |
| 2431 | bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order); |
| 2432 | bool atomic_flag_test_and_set_explicit(atomic_flag*, memory_order); |
| 2433 | void atomic_flag_clear(volatile atomic_flag*); |
| 2434 | void atomic_flag_clear(atomic_flag*); |
| 2435 | void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order); |
| 2436 | void atomic_flag_clear_explicit(atomic_flag*, memory_order); |
| 2437 | |
| 2438 | typedef struct _LIBCPP_VISIBLE atomic_flag |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2439 | { |
Howard Hinnant | 6cac2c2 | 2010-10-05 14:02:23 +0000 | [diff] [blame] | 2440 | __atomic_flag__ __flg_; |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2441 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2442 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2443 | bool test_and_set(memory_order __o = memory_order_seq_cst) volatile |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2444 | {return atomic_flag_test_and_set_explicit(this, __o);} |
| 2445 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2446 | bool test_and_set(memory_order __o = memory_order_seq_cst) |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2447 | {return atomic_flag_test_and_set_explicit(this, __o);} |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2448 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2449 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2450 | void clear(memory_order __o = memory_order_seq_cst) volatile |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2451 | {atomic_flag_clear_explicit(this, __o);} |
| 2452 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2453 | void clear(memory_order __o = memory_order_seq_cst) |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2454 | {atomic_flag_clear_explicit(this, __o);} |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2455 | |
| 2456 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 2457 | atomic_flag() = default; |
| 2458 | #else |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2459 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 79101ae | 2010-09-30 21:05:29 +0000 | [diff] [blame] | 2460 | atomic_flag() {}; |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2461 | #endif |
| 2462 | |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2463 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 2464 | atomic_flag(const atomic_flag&) = delete; |
| 2465 | atomic_flag& operator=(const atomic_flag&) = delete; |
| 2466 | atomic_flag& operator=(const atomic_flag&) volatile = delete; |
| 2467 | #else |
| 2468 | private: |
| 2469 | atomic_flag(const atomic_flag&); |
| 2470 | atomic_flag& operator=(const atomic_flag&); |
| 2471 | atomic_flag& operator=(const atomic_flag&) volatile; |
| 2472 | public: |
| 2473 | #endif |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2474 | } atomic_flag; |
| 2475 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2476 | inline _LIBCPP_INLINE_VISIBILITY |
| 2477 | bool |
| 2478 | atomic_flag_test_and_set(volatile atomic_flag* __f) |
| 2479 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2480 | return __atomic_exchange(&__f->__flg_, __atomic_flag__(true), |
| 2481 | memory_order_seq_cst) |
Howard Hinnant | 6cac2c2 | 2010-10-05 14:02:23 +0000 | [diff] [blame] | 2482 | == __atomic_flag__(true); |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2483 | } |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2484 | |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2485 | inline _LIBCPP_INLINE_VISIBILITY |
| 2486 | bool |
| 2487 | atomic_flag_test_and_set(atomic_flag* __f) |
| 2488 | { |
| 2489 | return atomic_flag_test_and_set(const_cast<volatile atomic_flag*>(__f)); |
| 2490 | } |
| 2491 | |
| 2492 | inline _LIBCPP_INLINE_VISIBILITY |
| 2493 | bool |
| 2494 | atomic_flag_test_and_set_explicit(volatile atomic_flag* __f, memory_order __o) |
| 2495 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2496 | return __atomic_exchange(&__f->__flg_, __atomic_flag__(true), __o) |
Howard Hinnant | 6cac2c2 | 2010-10-05 14:02:23 +0000 | [diff] [blame] | 2497 | == __atomic_flag__(true); |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2498 | } |
| 2499 | |
| 2500 | inline _LIBCPP_INLINE_VISIBILITY |
| 2501 | bool |
| 2502 | atomic_flag_test_and_set_explicit(atomic_flag* __f, memory_order __o) |
| 2503 | { |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2504 | return atomic_flag_test_and_set_explicit(const_cast<volatile atomic_flag*> |
| 2505 | (__f), __o); |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2506 | } |
| 2507 | |
| 2508 | inline _LIBCPP_INLINE_VISIBILITY |
| 2509 | void |
| 2510 | atomic_flag_clear(volatile atomic_flag* __f) |
| 2511 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2512 | __atomic_store(&__f->__flg_, __atomic_flag__(false), memory_order_seq_cst); |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2513 | } |
| 2514 | |
| 2515 | inline _LIBCPP_INLINE_VISIBILITY |
| 2516 | void |
| 2517 | atomic_flag_clear(atomic_flag* __f) |
| 2518 | { |
| 2519 | atomic_flag_clear(const_cast<volatile atomic_flag*>(__f)); |
| 2520 | } |
| 2521 | |
| 2522 | inline _LIBCPP_INLINE_VISIBILITY |
| 2523 | void |
| 2524 | atomic_flag_clear_explicit(volatile atomic_flag* __f, memory_order __o) |
| 2525 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2526 | __atomic_store(&__f->__flg_, __atomic_flag__(false), __o); |
Howard Hinnant | 767ae2b | 2010-09-29 21:20:03 +0000 | [diff] [blame] | 2527 | } |
| 2528 | |
| 2529 | inline _LIBCPP_INLINE_VISIBILITY |
| 2530 | void |
| 2531 | atomic_flag_clear_explicit(atomic_flag* __f, memory_order __o) |
| 2532 | { |
| 2533 | atomic_flag_clear_explicit(const_cast<volatile atomic_flag*>(__f), __o); |
| 2534 | } |
| 2535 | |
| 2536 | #define ATOMIC_FLAG_INIT {false} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2537 | #define ATOMIC_VAR_INIT(__v) {__v} |
| 2538 | |
| 2539 | inline _LIBCPP_INLINE_VISIBILITY |
| 2540 | memory_order |
| 2541 | __translate_memory_order(memory_order __o) |
| 2542 | { |
| 2543 | switch (__o) |
| 2544 | { |
| 2545 | case memory_order_acq_rel: |
| 2546 | return memory_order_acquire; |
| 2547 | case memory_order_release: |
| 2548 | return memory_order_relaxed; |
| 2549 | } |
| 2550 | return __o; |
| 2551 | } |
| 2552 | |
| 2553 | // atomic_bool |
| 2554 | |
| 2555 | struct atomic_bool; |
| 2556 | |
| 2557 | bool atomic_is_lock_free(const volatile atomic_bool*); |
| 2558 | bool atomic_is_lock_free(const atomic_bool*); |
| 2559 | void atomic_init(volatile atomic_bool*, bool); |
| 2560 | void atomic_init(atomic_bool*, bool); |
| 2561 | void atomic_store(volatile atomic_bool*, bool); |
| 2562 | void atomic_store(atomic_bool*, bool); |
| 2563 | void atomic_store_explicit(volatile atomic_bool*, bool, memory_order); |
| 2564 | void atomic_store_explicit(atomic_bool*, bool, memory_order); |
| 2565 | bool atomic_load(const volatile atomic_bool*); |
| 2566 | bool atomic_load(const atomic_bool*); |
| 2567 | bool atomic_load_explicit(const volatile atomic_bool*, memory_order); |
| 2568 | bool atomic_load_explicit(const atomic_bool*, memory_order); |
| 2569 | bool atomic_exchange(volatile atomic_bool*, bool); |
| 2570 | bool atomic_exchange(atomic_bool*, bool); |
| 2571 | bool atomic_exchange_explicit(volatile atomic_bool*, bool, memory_order); |
| 2572 | bool atomic_exchange_explicit(atomic_bool*, bool, memory_order); |
| 2573 | bool atomic_compare_exchange_weak(volatile atomic_bool*, bool*, bool); |
| 2574 | bool atomic_compare_exchange_weak(atomic_bool*, bool*, bool); |
| 2575 | bool atomic_compare_exchange_strong(volatile atomic_bool*, bool*, bool); |
| 2576 | bool atomic_compare_exchange_strong(atomic_bool*, bool*, bool); |
| 2577 | bool atomic_compare_exchange_weak_explicit(volatile atomic_bool*, bool*, bool, |
| 2578 | memory_order, memory_order); |
| 2579 | bool atomic_compare_exchange_weak_explicit(atomic_bool*, bool*, bool, |
| 2580 | memory_order, memory_order); |
| 2581 | bool atomic_compare_exchange_strong_explicit(volatile atomic_bool*, bool*, bool, |
| 2582 | memory_order, memory_order); |
| 2583 | bool atomic_compare_exchange_strong_explicit(atomic_bool*, bool*, bool, |
| 2584 | memory_order, memory_order); |
| 2585 | |
| 2586 | typedef struct atomic_bool |
| 2587 | { |
| 2588 | bool __v_; |
| 2589 | |
| 2590 | _LIBCPP_INLINE_VISIBILITY |
| 2591 | bool is_lock_free() const volatile |
| 2592 | {return atomic_is_lock_free(this);} |
| 2593 | _LIBCPP_INLINE_VISIBILITY |
| 2594 | bool is_lock_free() const |
| 2595 | {return atomic_is_lock_free(this);} |
| 2596 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2597 | void store(bool __v, memory_order __o = memory_order_seq_cst) volatile |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2598 | {atomic_store_explicit(this, __v, __o);} |
| 2599 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2600 | void store(bool __v, memory_order __o = memory_order_seq_cst) |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2601 | {atomic_store_explicit(this, __v, __o);} |
| 2602 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2603 | bool load(memory_order __o = memory_order_seq_cst) const volatile |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2604 | {return atomic_load_explicit(this, __o);} |
| 2605 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2606 | bool load(memory_order __o = memory_order_seq_cst) const |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2607 | {return atomic_load_explicit(this, __o);} |
| 2608 | _LIBCPP_INLINE_VISIBILITY |
| 2609 | operator bool() const volatile |
| 2610 | {return load();} |
| 2611 | _LIBCPP_INLINE_VISIBILITY |
| 2612 | operator bool() const |
| 2613 | {return load();} |
| 2614 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2615 | bool exchange(bool __v, memory_order __o = memory_order_seq_cst) volatile |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2616 | {return atomic_exchange_explicit(this, __v, __o);} |
| 2617 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2618 | bool exchange(bool __v, memory_order __o = memory_order_seq_cst) |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2619 | {return atomic_exchange_explicit(this, __v, __o);} |
| 2620 | _LIBCPP_INLINE_VISIBILITY |
| 2621 | bool compare_exchange_weak(bool& __v, bool __e, memory_order __s, |
| 2622 | memory_order __f) volatile |
| 2623 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2624 | __f);} |
| 2625 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2626 | bool compare_exchange_weak(bool& __v, bool __e, |
| 2627 | memory_order __s = memory_order_seq_cst) volatile |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2628 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2629 | __translate_memory_order(__s));} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2630 | _LIBCPP_INLINE_VISIBILITY |
| 2631 | bool compare_exchange_weak(bool& __v, bool __e, memory_order __s, |
| 2632 | memory_order __f) |
| 2633 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2634 | __f);} |
| 2635 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2636 | bool compare_exchange_weak(bool& __v, bool __e, |
| 2637 | memory_order __s = memory_order_seq_cst) |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2638 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2639 | __translate_memory_order(__s));} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2640 | _LIBCPP_INLINE_VISIBILITY |
| 2641 | bool compare_exchange_strong(bool& __v, bool __e, memory_order __s, |
| 2642 | memory_order __f) volatile |
| 2643 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2644 | __f);} |
| 2645 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2646 | bool compare_exchange_strong(bool& __v, bool __e, |
| 2647 | memory_order __s = memory_order_seq_cst) volatile |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2648 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2649 | __translate_memory_order(__s));} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2650 | _LIBCPP_INLINE_VISIBILITY |
| 2651 | bool compare_exchange_strong(bool& __v, bool __e, memory_order __s, |
| 2652 | memory_order __f) |
| 2653 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2654 | __f);} |
| 2655 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2656 | bool compare_exchange_strong(bool& __v, bool __e, |
| 2657 | memory_order __s = memory_order_seq_cst) |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2658 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2659 | __translate_memory_order(__s));} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2660 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 2661 | atomic_bool() = default; |
| 2662 | #else |
| 2663 | _LIBCPP_INLINE_VISIBILITY |
| 2664 | atomic_bool() {} |
| 2665 | #endif |
| 2666 | _LIBCPP_INLINE_VISIBILITY |
| 2667 | /*constexpr*/ atomic_bool(bool __v) |
| 2668 | : __v_(__v) {} |
| 2669 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 2670 | atomic_bool(const atomic_bool&) = delete; |
| 2671 | atomic_bool& operator=(const atomic_bool&) = delete; |
| 2672 | atomic_bool& operator=(const atomic_bool&) volatile = delete; |
| 2673 | #else |
| 2674 | private: |
| 2675 | atomic_bool(const atomic_bool&); |
| 2676 | atomic_bool& operator=(const atomic_bool&); |
| 2677 | atomic_bool& operator=(const atomic_bool&) volatile; |
| 2678 | public: |
| 2679 | #endif |
| 2680 | _LIBCPP_INLINE_VISIBILITY |
| 2681 | bool operator=(bool __v) volatile |
| 2682 | {store(__v); return __v;} |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 2683 | _LIBCPP_INLINE_VISIBILITY |
| 2684 | bool operator=(bool __v) |
| 2685 | {store(__v); return __v;} |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2686 | } atomic_bool; |
| 2687 | |
| 2688 | inline _LIBCPP_INLINE_VISIBILITY |
| 2689 | bool atomic_is_lock_free(const volatile atomic_bool*) |
| 2690 | { |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 2691 | typedef bool type; |
| 2692 | return __atomic_is_lock_free(type); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2693 | } |
| 2694 | |
| 2695 | inline _LIBCPP_INLINE_VISIBILITY |
| 2696 | bool atomic_is_lock_free(const atomic_bool* __obj) |
| 2697 | { |
| 2698 | return atomic_is_lock_free(const_cast<const volatile atomic_bool*>(__obj)); |
| 2699 | } |
| 2700 | |
| 2701 | inline _LIBCPP_INLINE_VISIBILITY |
| 2702 | void atomic_init(volatile atomic_bool* __obj, bool __desr) |
| 2703 | { |
| 2704 | __obj->__v_ = __desr; |
| 2705 | } |
| 2706 | |
| 2707 | inline _LIBCPP_INLINE_VISIBILITY |
| 2708 | void atomic_init(atomic_bool* __obj, bool __desr) |
| 2709 | { |
| 2710 | __obj->__v_ = __desr; |
| 2711 | } |
| 2712 | |
| 2713 | inline _LIBCPP_INLINE_VISIBILITY |
| 2714 | void atomic_store(volatile atomic_bool* __obj, bool __desr) |
| 2715 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2716 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2717 | } |
| 2718 | |
| 2719 | inline _LIBCPP_INLINE_VISIBILITY |
| 2720 | void atomic_store(atomic_bool* __obj, bool __desr) |
| 2721 | { |
| 2722 | atomic_store(const_cast<volatile atomic_bool*>(__obj), __desr); |
| 2723 | } |
| 2724 | |
| 2725 | inline _LIBCPP_INLINE_VISIBILITY |
| 2726 | void atomic_store_explicit(volatile atomic_bool* __obj, bool __desr, |
| 2727 | memory_order __o) |
| 2728 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2729 | __atomic_store(&__obj->__v_, __desr, __o); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2730 | } |
| 2731 | |
| 2732 | inline _LIBCPP_INLINE_VISIBILITY |
| 2733 | void atomic_store_explicit(atomic_bool* __obj, bool __desr, memory_order __o) |
| 2734 | { |
| 2735 | atomic_store_explicit(const_cast<volatile atomic_bool*>(__obj), __desr, |
| 2736 | __o); |
| 2737 | } |
| 2738 | |
| 2739 | inline _LIBCPP_INLINE_VISIBILITY |
| 2740 | bool atomic_load(const volatile atomic_bool* __obj) |
| 2741 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2742 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2743 | } |
| 2744 | |
| 2745 | inline _LIBCPP_INLINE_VISIBILITY |
| 2746 | bool atomic_load(const atomic_bool* __obj) |
| 2747 | { |
| 2748 | return atomic_load(const_cast<const volatile atomic_bool*>(__obj)); |
| 2749 | } |
| 2750 | |
| 2751 | inline _LIBCPP_INLINE_VISIBILITY |
| 2752 | bool atomic_load_explicit(const volatile atomic_bool* __obj, memory_order __o) |
| 2753 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2754 | return __atomic_load(&__obj->__v_, __o); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | inline _LIBCPP_INLINE_VISIBILITY |
| 2758 | bool atomic_load_explicit(const atomic_bool* __obj, memory_order __o) |
| 2759 | { |
| 2760 | return atomic_load_explicit(const_cast<const volatile atomic_bool*> |
| 2761 | (__obj), __o); |
| 2762 | } |
| 2763 | |
| 2764 | inline _LIBCPP_INLINE_VISIBILITY |
| 2765 | bool atomic_exchange(volatile atomic_bool* __obj, bool __desr) |
| 2766 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2767 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2768 | } |
| 2769 | |
| 2770 | inline _LIBCPP_INLINE_VISIBILITY |
| 2771 | bool atomic_exchange(atomic_bool* __obj, bool __desr) |
| 2772 | { |
| 2773 | return atomic_exchange(const_cast<volatile atomic_bool*>(__obj), __desr); |
| 2774 | } |
| 2775 | |
| 2776 | inline _LIBCPP_INLINE_VISIBILITY |
| 2777 | bool atomic_exchange_explicit(volatile atomic_bool* __obj, bool __desr, |
| 2778 | memory_order __o) |
| 2779 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2780 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2781 | } |
| 2782 | |
| 2783 | inline _LIBCPP_INLINE_VISIBILITY |
| 2784 | bool atomic_exchange_explicit(atomic_bool* __obj, bool __desr, memory_order __o) |
| 2785 | { |
| 2786 | return atomic_exchange_explicit(const_cast<volatile atomic_bool*> |
| 2787 | (__obj), __desr, __o); |
| 2788 | } |
| 2789 | |
| 2790 | inline _LIBCPP_INLINE_VISIBILITY |
| 2791 | bool atomic_compare_exchange_weak(volatile atomic_bool* __obj, bool* __exp, |
| 2792 | bool __desr) |
| 2793 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2794 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 2795 | memory_order_seq_cst, memory_order_seq_cst); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2796 | } |
| 2797 | |
| 2798 | inline _LIBCPP_INLINE_VISIBILITY |
| 2799 | bool atomic_compare_exchange_weak(atomic_bool* __obj, bool* __exp, bool __desr) |
| 2800 | { |
| 2801 | return atomic_compare_exchange_weak(const_cast<volatile atomic_bool*> |
| 2802 | (__obj), __exp, __desr); |
| 2803 | } |
| 2804 | |
| 2805 | inline _LIBCPP_INLINE_VISIBILITY |
| 2806 | bool atomic_compare_exchange_weak_explicit(volatile atomic_bool* __obj, |
| 2807 | bool* __exp, bool __desr, |
| 2808 | memory_order __s, memory_order __f) |
| 2809 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2810 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 2811 | __f); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2812 | } |
| 2813 | |
| 2814 | inline _LIBCPP_INLINE_VISIBILITY |
| 2815 | bool atomic_compare_exchange_weak_explicit(atomic_bool* __obj, bool* __exp, |
| 2816 | bool __desr, |
| 2817 | memory_order __s, memory_order __f) |
| 2818 | { |
| 2819 | return atomic_compare_exchange_weak_explicit( |
| 2820 | const_cast<volatile atomic_bool*>(__obj), __exp, __desr, __s, __f); |
| 2821 | } |
| 2822 | |
| 2823 | inline _LIBCPP_INLINE_VISIBILITY |
| 2824 | bool atomic_compare_exchange_strong(volatile atomic_bool* __obj, bool* __exp, |
| 2825 | bool __desr) |
| 2826 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2827 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 2828 | memory_order_seq_cst, memory_order_seq_cst); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2829 | } |
| 2830 | |
| 2831 | inline _LIBCPP_INLINE_VISIBILITY |
| 2832 | bool atomic_compare_exchange_strong(atomic_bool* __obj, bool* __exp, |
| 2833 | bool __desr) |
| 2834 | { |
| 2835 | return atomic_compare_exchange_strong(const_cast<volatile atomic_bool*> |
| 2836 | (__obj), __exp, __desr); |
| 2837 | } |
| 2838 | |
| 2839 | inline _LIBCPP_INLINE_VISIBILITY |
| 2840 | bool atomic_compare_exchange_strong_explicit(volatile atomic_bool* __obj, |
| 2841 | bool* __exp, bool __desr, |
| 2842 | memory_order __s, memory_order __f) |
| 2843 | { |
Howard Hinnant | 21ef47f | 2010-10-18 20:39:07 +0000 | [diff] [blame] | 2844 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 2845 | __f); |
Howard Hinnant | 611fdaf | 2010-10-04 18:52:54 +0000 | [diff] [blame] | 2846 | } |
| 2847 | |
| 2848 | inline _LIBCPP_INLINE_VISIBILITY |
| 2849 | bool atomic_compare_exchange_strong_explicit(atomic_bool* __obj, bool* __exp, |
| 2850 | bool __desr, |
| 2851 | memory_order __s, memory_order __f) |
| 2852 | { |
| 2853 | return atomic_compare_exchange_strong_explicit( |
| 2854 | const_cast<volatile atomic_bool*>(__obj), __exp, __desr, __s, __f); |
| 2855 | } |
Howard Hinnant | ed760f4 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 2856 | |
Howard Hinnant | e738501 | 2010-10-19 16:51:18 +0000 | [diff] [blame^] | 2857 | // atomic_char |
| 2858 | |
| 2859 | struct atomic_char; |
| 2860 | |
| 2861 | bool atomic_is_lock_free(const volatile atomic_char*); |
| 2862 | bool atomic_is_lock_free(const atomic_char*); |
| 2863 | void atomic_init(volatile atomic_char*, char); |
| 2864 | void atomic_init(atomic_char*, char); |
| 2865 | void atomic_store(volatile atomic_char*, char); |
| 2866 | void atomic_store(atomic_char*, char); |
| 2867 | void atomic_store_explicit(volatile atomic_char*, char, memory_order); |
| 2868 | void atomic_store_explicit(atomic_char*, char, memory_order); |
| 2869 | char atomic_load(const volatile atomic_char*); |
| 2870 | char atomic_load(const atomic_char*); |
| 2871 | char atomic_load_explicit(const volatile atomic_char*, memory_order); |
| 2872 | char atomic_load_explicit(const atomic_char*, memory_order); |
| 2873 | char atomic_exchange(volatile atomic_char*, char); |
| 2874 | char atomic_exchange(atomic_char*, char); |
| 2875 | char atomic_exchange_explicit(volatile atomic_char*, char, memory_order); |
| 2876 | char atomic_exchange_explicit(atomic_char*, char, memory_order); |
| 2877 | bool atomic_compare_exchange_weak(volatile atomic_char*, char*, char); |
| 2878 | bool atomic_compare_exchange_weak(atomic_char*, char*, char); |
| 2879 | bool atomic_compare_exchange_strong(volatile atomic_char*, char*, char); |
| 2880 | bool atomic_compare_exchange_strong(atomic_char*, char*, char); |
| 2881 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char*, char*, char, |
| 2882 | memory_order, memory_order); |
| 2883 | bool atomic_compare_exchange_weak_explicit(atomic_char*, char*, char, |
| 2884 | memory_order, memory_order); |
| 2885 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char*, char*, char, |
| 2886 | memory_order, memory_order); |
| 2887 | bool atomic_compare_exchange_strong_explicit(atomic_char*, char*, char, |
| 2888 | memory_order, memory_order); |
| 2889 | char atomic_fetch_add(volatile atomic_char*, char); |
| 2890 | char atomic_fetch_add(atomic_char*, char); |
| 2891 | char atomic_fetch_add_explicit(volatile atomic_char*, char, memory_order); |
| 2892 | char atomic_fetch_add_explicit(atomic_char*, char, memory_order); |
| 2893 | char atomic_fetch_sub(volatile atomic_char*, char); |
| 2894 | char atomic_fetch_sub(atomic_char*, char); |
| 2895 | char atomic_fetch_sub_explicit(volatile atomic_char*, char, memory_order); |
| 2896 | char atomic_fetch_sub_explicit(atomic_char*, char, memory_order); |
| 2897 | char atomic_fetch_and(volatile atomic_char*, char); |
| 2898 | char atomic_fetch_and(atomic_char*, char); |
| 2899 | char atomic_fetch_and_explicit(volatile atomic_char*, char, memory_order); |
| 2900 | char atomic_fetch_and_explicit(atomic_char*, char, memory_order); |
| 2901 | char atomic_fetch_or(volatile atomic_char*, char); |
| 2902 | char atomic_fetch_or(atomic_char*, char); |
| 2903 | char atomic_fetch_or_explicit(volatile atomic_char*, char, memory_order); |
| 2904 | char atomic_fetch_or_explicit(atomic_char*, char, memory_order); |
| 2905 | char atomic_fetch_xor(volatile atomic_char*, char); |
| 2906 | char atomic_fetch_xor(atomic_char*, char); |
| 2907 | char atomic_fetch_xor_explicit(volatile atomic_char*, char, memory_order); |
| 2908 | char atomic_fetch_xor_explicit(atomic_char*, char, memory_order); |
| 2909 | |
| 2910 | typedef struct atomic_char |
| 2911 | { |
| 2912 | char __v_; |
| 2913 | |
| 2914 | _LIBCPP_INLINE_VISIBILITY |
| 2915 | bool is_lock_free() const volatile |
| 2916 | {return atomic_is_lock_free(this);} |
| 2917 | _LIBCPP_INLINE_VISIBILITY |
| 2918 | bool is_lock_free() const |
| 2919 | {return atomic_is_lock_free(this);} |
| 2920 | _LIBCPP_INLINE_VISIBILITY |
| 2921 | void store(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 2922 | {atomic_store_explicit(this, __v, __o);} |
| 2923 | _LIBCPP_INLINE_VISIBILITY |
| 2924 | void store(char __v, memory_order __o = memory_order_seq_cst) |
| 2925 | {atomic_store_explicit(this, __v, __o);} |
| 2926 | _LIBCPP_INLINE_VISIBILITY |
| 2927 | char load(memory_order __o = memory_order_seq_cst) const volatile |
| 2928 | {return atomic_load_explicit(this, __o);} |
| 2929 | _LIBCPP_INLINE_VISIBILITY |
| 2930 | char load(memory_order __o = memory_order_seq_cst) const |
| 2931 | {return atomic_load_explicit(this, __o);} |
| 2932 | _LIBCPP_INLINE_VISIBILITY |
| 2933 | operator char() const volatile |
| 2934 | {return load();} |
| 2935 | _LIBCPP_INLINE_VISIBILITY |
| 2936 | operator char() const |
| 2937 | {return load();} |
| 2938 | _LIBCPP_INLINE_VISIBILITY |
| 2939 | char exchange(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 2940 | {return atomic_exchange_explicit(this, __v, __o);} |
| 2941 | _LIBCPP_INLINE_VISIBILITY |
| 2942 | char exchange(char __v, memory_order __o = memory_order_seq_cst) |
| 2943 | {return atomic_exchange_explicit(this, __v, __o);} |
| 2944 | _LIBCPP_INLINE_VISIBILITY |
| 2945 | bool compare_exchange_weak(char& __v, char __e, memory_order __s, |
| 2946 | memory_order __f) volatile |
| 2947 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2948 | __f);} |
| 2949 | _LIBCPP_INLINE_VISIBILITY |
| 2950 | bool compare_exchange_weak(char& __v, char __e, memory_order __s, |
| 2951 | memory_order __f) |
| 2952 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2953 | __f);} |
| 2954 | _LIBCPP_INLINE_VISIBILITY |
| 2955 | bool compare_exchange_strong(char& __v, char __e, memory_order __s, |
| 2956 | memory_order __f) volatile |
| 2957 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2958 | __f);} |
| 2959 | _LIBCPP_INLINE_VISIBILITY |
| 2960 | bool compare_exchange_strong(char& __v, char __e, memory_order __s, |
| 2961 | memory_order __f) |
| 2962 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2963 | __f);} |
| 2964 | _LIBCPP_INLINE_VISIBILITY |
| 2965 | bool compare_exchange_weak(char& __v, char __e, |
| 2966 | memory_order __s = memory_order_seq_cst) volatile |
| 2967 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2968 | __translate_memory_order(__s));} |
| 2969 | _LIBCPP_INLINE_VISIBILITY |
| 2970 | bool compare_exchange_weak(char& __v, char __e, |
| 2971 | memory_order __s = memory_order_seq_cst) |
| 2972 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 2973 | __translate_memory_order(__s));} |
| 2974 | _LIBCPP_INLINE_VISIBILITY |
| 2975 | bool compare_exchange_strong(char& __v, char __e, |
| 2976 | memory_order __s = memory_order_seq_cst) volatile |
| 2977 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2978 | __translate_memory_order(__s));} |
| 2979 | _LIBCPP_INLINE_VISIBILITY |
| 2980 | bool compare_exchange_strong(char& __v, char __e, |
| 2981 | memory_order __s = memory_order_seq_cst) |
| 2982 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 2983 | __translate_memory_order(__s));} |
| 2984 | _LIBCPP_INLINE_VISIBILITY |
| 2985 | char fetch_add(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 2986 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 2987 | _LIBCPP_INLINE_VISIBILITY |
| 2988 | char fetch_add(char __v, memory_order __o = memory_order_seq_cst) |
| 2989 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 2990 | _LIBCPP_INLINE_VISIBILITY |
| 2991 | char fetch_sub(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 2992 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 2993 | _LIBCPP_INLINE_VISIBILITY |
| 2994 | char fetch_sub(char __v, memory_order __o = memory_order_seq_cst) |
| 2995 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 2996 | _LIBCPP_INLINE_VISIBILITY |
| 2997 | char fetch_and(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 2998 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 2999 | _LIBCPP_INLINE_VISIBILITY |
| 3000 | char fetch_and(char __v, memory_order __o = memory_order_seq_cst) |
| 3001 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 3002 | _LIBCPP_INLINE_VISIBILITY |
| 3003 | char fetch_or(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 3004 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 3005 | _LIBCPP_INLINE_VISIBILITY |
| 3006 | char fetch_or(char __v, memory_order __o = memory_order_seq_cst) |
| 3007 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 3008 | _LIBCPP_INLINE_VISIBILITY |
| 3009 | char fetch_xor(char __v, memory_order __o = memory_order_seq_cst) volatile |
| 3010 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 3011 | _LIBCPP_INLINE_VISIBILITY |
| 3012 | char fetch_xor(char __v, memory_order __o = memory_order_seq_cst) |
| 3013 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 3014 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 3015 | atomic_char() = default; |
| 3016 | #else |
| 3017 | _LIBCPP_INLINE_VISIBILITY |
| 3018 | atomic_char() {} |
| 3019 | #endif |
| 3020 | _LIBCPP_INLINE_VISIBILITY |
| 3021 | /*constexpr*/ atomic_char(char __v) |
| 3022 | : __v_(__v) {} |
| 3023 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 3024 | atomic_char(const atomic_char&) = delete; |
| 3025 | atomic_char& operator=(const atomic_char&) = delete; |
| 3026 | atomic_char& operator=(const atomic_char&) volatile = delete; |
| 3027 | #else |
| 3028 | private: |
| 3029 | atomic_char(const atomic_char&); |
| 3030 | atomic_char& operator=(const atomic_char&); |
| 3031 | atomic_char& operator=(const atomic_char&) volatile; |
| 3032 | public: |
| 3033 | #endif |
| 3034 | _LIBCPP_INLINE_VISIBILITY |
| 3035 | char operator=(char __v) volatile |
| 3036 | {store(__v); return __v;} |
| 3037 | _LIBCPP_INLINE_VISIBILITY |
| 3038 | char operator=(char __v) |
| 3039 | {store(__v); return __v;} |
| 3040 | _LIBCPP_INLINE_VISIBILITY |
| 3041 | char operator++(int) volatile |
| 3042 | {return fetch_add(char(1));} |
| 3043 | _LIBCPP_INLINE_VISIBILITY |
| 3044 | char operator++(int) |
| 3045 | {return fetch_add(char(1));} |
| 3046 | _LIBCPP_INLINE_VISIBILITY |
| 3047 | char operator--(int) volatile |
| 3048 | {return fetch_sub(char(1));} |
| 3049 | _LIBCPP_INLINE_VISIBILITY |
| 3050 | char operator--(int) |
| 3051 | {return fetch_sub(char(1));} |
| 3052 | _LIBCPP_INLINE_VISIBILITY |
| 3053 | char operator++() volatile |
| 3054 | {return char(fetch_add(char(1)) + 1);} |
| 3055 | _LIBCPP_INLINE_VISIBILITY |
| 3056 | char operator++() |
| 3057 | {return char(fetch_add(char(1)) + 1);} |
| 3058 | _LIBCPP_INLINE_VISIBILITY |
| 3059 | char operator--() volatile |
| 3060 | {return char(fetch_sub(char(1)) - 1);} |
| 3061 | _LIBCPP_INLINE_VISIBILITY |
| 3062 | char operator--() |
| 3063 | {return char(fetch_sub(char(1)) - 1);} |
| 3064 | _LIBCPP_INLINE_VISIBILITY |
| 3065 | char operator+=(char __v) volatile |
| 3066 | {return char(fetch_add(__v) + __v);} |
| 3067 | _LIBCPP_INLINE_VISIBILITY |
| 3068 | char operator+=(char __v) |
| 3069 | {return char(fetch_add(__v) + __v);} |
| 3070 | _LIBCPP_INLINE_VISIBILITY |
| 3071 | char operator-=(char __v) volatile |
| 3072 | {return char(fetch_sub(__v) - __v);} |
| 3073 | _LIBCPP_INLINE_VISIBILITY |
| 3074 | char operator-=(char __v) |
| 3075 | {return char(fetch_sub(__v) - __v);} |
| 3076 | _LIBCPP_INLINE_VISIBILITY |
| 3077 | char operator&=(char __v) volatile |
| 3078 | {return char(fetch_and(__v) & __v);} |
| 3079 | _LIBCPP_INLINE_VISIBILITY |
| 3080 | char operator&=(char __v) |
| 3081 | {return char(fetch_and(__v) & __v);} |
| 3082 | _LIBCPP_INLINE_VISIBILITY |
| 3083 | char operator|=(char __v) volatile |
| 3084 | {return char(fetch_or(__v) | __v);} |
| 3085 | _LIBCPP_INLINE_VISIBILITY |
| 3086 | char operator|=(char __v) |
| 3087 | {return char(fetch_or(__v) | __v);} |
| 3088 | _LIBCPP_INLINE_VISIBILITY |
| 3089 | char operator^=(char __v) volatile |
| 3090 | {return char(fetch_xor(__v) ^ __v);} |
| 3091 | _LIBCPP_INLINE_VISIBILITY |
| 3092 | char operator^=(char __v) |
| 3093 | {return char(fetch_xor(__v) ^ __v);} |
| 3094 | } atomic_char; |
| 3095 | |
| 3096 | inline _LIBCPP_INLINE_VISIBILITY |
| 3097 | bool |
| 3098 | atomic_is_lock_free(const volatile atomic_char*) |
| 3099 | { |
| 3100 | typedef char type; |
| 3101 | return __atomic_is_lock_free(type); |
| 3102 | } |
| 3103 | |
| 3104 | inline _LIBCPP_INLINE_VISIBILITY |
| 3105 | bool |
| 3106 | atomic_is_lock_free(const atomic_char* __obj) |
| 3107 | { |
| 3108 | return atomic_is_lock_free(const_cast<volatile atomic_char*>(__obj)); |
| 3109 | } |
| 3110 | |
| 3111 | inline _LIBCPP_INLINE_VISIBILITY |
| 3112 | void |
| 3113 | atomic_init(volatile atomic_char* __obj, char __desr) |
| 3114 | { |
| 3115 | __obj->__v_ = __desr; |
| 3116 | } |
| 3117 | |
| 3118 | inline _LIBCPP_INLINE_VISIBILITY |
| 3119 | void |
| 3120 | atomic_init(atomic_char* __obj, char __desr) |
| 3121 | { |
| 3122 | __obj->__v_ = __desr; |
| 3123 | } |
| 3124 | |
| 3125 | inline _LIBCPP_INLINE_VISIBILITY |
| 3126 | void |
| 3127 | atomic_store(volatile atomic_char* __obj, char __desr) |
| 3128 | { |
| 3129 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 3130 | } |
| 3131 | |
| 3132 | inline _LIBCPP_INLINE_VISIBILITY |
| 3133 | void |
| 3134 | atomic_store(atomic_char* __obj, char __desr) |
| 3135 | { |
| 3136 | atomic_store(const_cast<volatile atomic_char*>(__obj), __desr); |
| 3137 | } |
| 3138 | |
| 3139 | inline _LIBCPP_INLINE_VISIBILITY |
| 3140 | void |
| 3141 | atomic_store_explicit(volatile atomic_char* __obj, char __desr, |
| 3142 | memory_order __o) |
| 3143 | { |
| 3144 | __atomic_store(&__obj->__v_, __desr, __o); |
| 3145 | } |
| 3146 | |
| 3147 | inline _LIBCPP_INLINE_VISIBILITY |
| 3148 | void |
| 3149 | atomic_store_explicit(atomic_char* __obj, char __desr, memory_order __o) |
| 3150 | { |
| 3151 | atomic_store_explicit(const_cast<volatile atomic_char*>(__obj), __desr, |
| 3152 | __o); |
| 3153 | } |
| 3154 | |
| 3155 | inline _LIBCPP_INLINE_VISIBILITY |
| 3156 | char |
| 3157 | atomic_load(const volatile atomic_char* __obj) |
| 3158 | { |
| 3159 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 3160 | } |
| 3161 | |
| 3162 | inline _LIBCPP_INLINE_VISIBILITY |
| 3163 | char |
| 3164 | atomic_load(const atomic_char* __obj) |
| 3165 | { |
| 3166 | return atomic_load(const_cast<const volatile atomic_char*>(__obj)); |
| 3167 | } |
| 3168 | |
| 3169 | inline _LIBCPP_INLINE_VISIBILITY |
| 3170 | char |
| 3171 | atomic_load_explicit(const volatile atomic_char* __obj, memory_order __o) |
| 3172 | { |
| 3173 | return __atomic_load(&__obj->__v_, __o); |
| 3174 | } |
| 3175 | |
| 3176 | inline _LIBCPP_INLINE_VISIBILITY |
| 3177 | char |
| 3178 | atomic_load_explicit(const atomic_char* __obj, memory_order __o) |
| 3179 | { |
| 3180 | return atomic_load_explicit(const_cast<const volatile atomic_char*> |
| 3181 | (__obj), __o); |
| 3182 | } |
| 3183 | |
| 3184 | inline _LIBCPP_INLINE_VISIBILITY |
| 3185 | char |
| 3186 | atomic_exchange(volatile atomic_char* __obj, char __desr) |
| 3187 | { |
| 3188 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 3189 | } |
| 3190 | |
| 3191 | inline _LIBCPP_INLINE_VISIBILITY |
| 3192 | char |
| 3193 | atomic_exchange(atomic_char* __obj, char __desr) |
| 3194 | { |
| 3195 | return atomic_exchange(const_cast<volatile atomic_char*>(__obj), __desr); |
| 3196 | } |
| 3197 | |
| 3198 | inline _LIBCPP_INLINE_VISIBILITY |
| 3199 | char |
| 3200 | atomic_exchange_explicit(volatile atomic_char* __obj, char __desr, |
| 3201 | memory_order __o) |
| 3202 | { |
| 3203 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 3204 | } |
| 3205 | |
| 3206 | inline _LIBCPP_INLINE_VISIBILITY |
| 3207 | char |
| 3208 | atomic_exchange_explicit(atomic_char* __obj, char __desr, memory_order __o) |
| 3209 | { |
| 3210 | return atomic_exchange_explicit(const_cast<volatile atomic_char*> |
| 3211 | (__obj), __desr, __o); |
| 3212 | } |
| 3213 | |
| 3214 | inline _LIBCPP_INLINE_VISIBILITY |
| 3215 | bool |
| 3216 | atomic_compare_exchange_weak(volatile atomic_char* __obj, char* __exp, |
| 3217 | char __desr) |
| 3218 | { |
| 3219 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 3220 | memory_order_seq_cst, memory_order_seq_cst); |
| 3221 | } |
| 3222 | |
| 3223 | inline _LIBCPP_INLINE_VISIBILITY |
| 3224 | bool |
| 3225 | atomic_compare_exchange_weak(atomic_char* __obj, char* __exp, char __desr) |
| 3226 | { |
| 3227 | return atomic_compare_exchange_weak(const_cast<volatile atomic_char*> |
| 3228 | (__obj), __exp, __desr); |
| 3229 | } |
| 3230 | |
| 3231 | inline _LIBCPP_INLINE_VISIBILITY |
| 3232 | bool |
| 3233 | atomic_compare_exchange_strong(volatile atomic_char* __obj, char* __exp, |
| 3234 | char __desr) |
| 3235 | { |
| 3236 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 3237 | memory_order_seq_cst, memory_order_seq_cst); |
| 3238 | } |
| 3239 | |
| 3240 | inline _LIBCPP_INLINE_VISIBILITY |
| 3241 | bool |
| 3242 | atomic_compare_exchange_strong(atomic_char* __obj, char* __exp, char __desr) |
| 3243 | { |
| 3244 | return atomic_compare_exchange_strong(const_cast<volatile atomic_char*> |
| 3245 | (__obj), __exp, __desr); |
| 3246 | } |
| 3247 | |
| 3248 | inline _LIBCPP_INLINE_VISIBILITY |
| 3249 | bool |
| 3250 | atomic_compare_exchange_weak_explicit(volatile atomic_char* __obj, char* __exp, |
| 3251 | char __desr, memory_order __s, |
| 3252 | memory_order __f) |
| 3253 | { |
| 3254 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 3255 | __f); |
| 3256 | } |
| 3257 | |
| 3258 | inline _LIBCPP_INLINE_VISIBILITY |
| 3259 | bool |
| 3260 | atomic_compare_exchange_weak_explicit(atomic_char* __obj, char* __exp, |
| 3261 | char __desr, memory_order __s, |
| 3262 | memory_order __f) |
| 3263 | { |
| 3264 | return atomic_compare_exchange_weak_explicit( |
| 3265 | const_cast<volatile atomic_char*>(__obj), __exp, __desr, __s, __f); |
| 3266 | } |
| 3267 | |
| 3268 | inline _LIBCPP_INLINE_VISIBILITY |
| 3269 | bool |
| 3270 | atomic_compare_exchange_strong_explicit(volatile atomic_char* __obj, |
| 3271 | char* __exp, char __desr, |
| 3272 | memory_order __s, memory_order __f) |
| 3273 | { |
| 3274 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 3275 | __f); |
| 3276 | } |
| 3277 | |
| 3278 | inline _LIBCPP_INLINE_VISIBILITY |
| 3279 | bool |
| 3280 | atomic_compare_exchange_strong_explicit(atomic_char* __obj, char* __exp, |
| 3281 | char __desr, memory_order __s, |
| 3282 | memory_order __f) |
| 3283 | { |
| 3284 | return atomic_compare_exchange_strong_explicit( |
| 3285 | const_cast<volatile atomic_char*>(__obj), __exp, __desr, __s, __f); |
| 3286 | } |
| 3287 | |
| 3288 | inline _LIBCPP_INLINE_VISIBILITY |
| 3289 | char |
| 3290 | atomic_fetch_add(volatile atomic_char* __obj, char __v) |
| 3291 | { |
| 3292 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 3293 | } |
| 3294 | |
| 3295 | inline _LIBCPP_INLINE_VISIBILITY |
| 3296 | char |
| 3297 | atomic_fetch_add(atomic_char* __obj, char __v) |
| 3298 | { |
| 3299 | return atomic_fetch_add(const_cast<volatile atomic_char*>(__obj), __v); |
| 3300 | } |
| 3301 | |
| 3302 | inline _LIBCPP_INLINE_VISIBILITY |
| 3303 | char |
| 3304 | atomic_fetch_add_explicit(volatile atomic_char* __obj, char __v, |
| 3305 | memory_order __o) |
| 3306 | { |
| 3307 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 3308 | } |
| 3309 | |
| 3310 | inline _LIBCPP_INLINE_VISIBILITY |
| 3311 | char |
| 3312 | atomic_fetch_add_explicit(atomic_char* __obj, char __v, memory_order __o) |
| 3313 | { |
| 3314 | return atomic_fetch_add_explicit(const_cast<volatile atomic_char*>(__obj), |
| 3315 | __v, __o); |
| 3316 | } |
| 3317 | |
| 3318 | inline _LIBCPP_INLINE_VISIBILITY |
| 3319 | char |
| 3320 | atomic_fetch_sub(volatile atomic_char* __obj, char __v) |
| 3321 | { |
| 3322 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 3323 | } |
| 3324 | |
| 3325 | inline _LIBCPP_INLINE_VISIBILITY |
| 3326 | char |
| 3327 | atomic_fetch_sub(atomic_char* __obj, char __v) |
| 3328 | { |
| 3329 | return atomic_fetch_sub(const_cast<volatile atomic_char*>(__obj), __v); |
| 3330 | } |
| 3331 | |
| 3332 | inline _LIBCPP_INLINE_VISIBILITY |
| 3333 | char |
| 3334 | atomic_fetch_sub_explicit(volatile atomic_char* __obj, char __v, |
| 3335 | memory_order __o) |
| 3336 | { |
| 3337 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 3338 | } |
| 3339 | |
| 3340 | inline _LIBCPP_INLINE_VISIBILITY |
| 3341 | char |
| 3342 | atomic_fetch_sub_explicit(atomic_char* __obj, char __v, memory_order __o) |
| 3343 | { |
| 3344 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_char*>(__obj), |
| 3345 | __v, __o); |
| 3346 | } |
| 3347 | |
| 3348 | inline _LIBCPP_INLINE_VISIBILITY |
| 3349 | char |
| 3350 | atomic_fetch_and(volatile atomic_char* __obj, char __v) |
| 3351 | { |
| 3352 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 3353 | } |
| 3354 | |
| 3355 | inline _LIBCPP_INLINE_VISIBILITY |
| 3356 | char |
| 3357 | atomic_fetch_and(atomic_char* __obj, char __v) |
| 3358 | { |
| 3359 | return atomic_fetch_and(const_cast<volatile atomic_char*>(__obj), __v); |
| 3360 | } |
| 3361 | |
| 3362 | inline _LIBCPP_INLINE_VISIBILITY |
| 3363 | char |
| 3364 | atomic_fetch_and_explicit(volatile atomic_char* __obj, char __v, |
| 3365 | memory_order __o) |
| 3366 | { |
| 3367 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 3368 | } |
| 3369 | |
| 3370 | inline _LIBCPP_INLINE_VISIBILITY |
| 3371 | char |
| 3372 | atomic_fetch_and_explicit(atomic_char* __obj, char __v, memory_order __o) |
| 3373 | { |
| 3374 | return atomic_fetch_and_explicit(const_cast<volatile atomic_char*>(__obj), |
| 3375 | __v, __o); |
| 3376 | } |
| 3377 | |
| 3378 | inline _LIBCPP_INLINE_VISIBILITY |
| 3379 | char |
| 3380 | atomic_fetch_or(volatile atomic_char* __obj, char __v) |
| 3381 | { |
| 3382 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 3383 | } |
| 3384 | |
| 3385 | inline _LIBCPP_INLINE_VISIBILITY |
| 3386 | char |
| 3387 | atomic_fetch_or(atomic_char* __obj, char __v) |
| 3388 | { |
| 3389 | return atomic_fetch_or(const_cast<volatile atomic_char*>(__obj), __v); |
| 3390 | } |
| 3391 | |
| 3392 | inline _LIBCPP_INLINE_VISIBILITY |
| 3393 | char |
| 3394 | atomic_fetch_or_explicit(volatile atomic_char* __obj, char __v, |
| 3395 | memory_order __o) |
| 3396 | { |
| 3397 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 3398 | } |
| 3399 | |
| 3400 | inline _LIBCPP_INLINE_VISIBILITY |
| 3401 | char |
| 3402 | atomic_fetch_or_explicit(atomic_char* __obj, char __v, memory_order __o) |
| 3403 | { |
| 3404 | return atomic_fetch_or_explicit(const_cast<volatile atomic_char*>(__obj), |
| 3405 | __v, __o); |
| 3406 | } |
| 3407 | |
| 3408 | inline _LIBCPP_INLINE_VISIBILITY |
| 3409 | char |
| 3410 | atomic_fetch_xor(volatile atomic_char* __obj, char __v) |
| 3411 | { |
| 3412 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 3413 | } |
| 3414 | |
| 3415 | inline _LIBCPP_INLINE_VISIBILITY |
| 3416 | char |
| 3417 | atomic_fetch_xor(atomic_char* __obj, char __v) |
| 3418 | { |
| 3419 | return atomic_fetch_xor(const_cast<volatile atomic_char*>(__obj), __v); |
| 3420 | } |
| 3421 | |
| 3422 | inline _LIBCPP_INLINE_VISIBILITY |
| 3423 | char |
| 3424 | atomic_fetch_xor_explicit(volatile atomic_char* __obj, char __v, |
| 3425 | memory_order __o) |
| 3426 | { |
| 3427 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 3428 | } |
| 3429 | |
| 3430 | inline _LIBCPP_INLINE_VISIBILITY |
| 3431 | char |
| 3432 | atomic_fetch_xor_explicit(atomic_char* __obj, char __v, memory_order __o) |
| 3433 | { |
| 3434 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_char*>(__obj), |
| 3435 | __v, __o); |
| 3436 | } |
| 3437 | |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 3438 | _LIBCPP_END_NAMESPACE_STD |
| 3439 | |
| 3440 | #endif // _LIBCPP_ATOMIC |