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 | 5bbe97d | 2010-10-19 21:22:10 +0000 | [diff] [blame] | 3438 | // atomic_schar |
| 3439 | |
| 3440 | struct atomic_schar; |
| 3441 | |
| 3442 | bool atomic_is_lock_free(const volatile atomic_schar*); |
| 3443 | bool atomic_is_lock_free(const atomic_schar*); |
| 3444 | void atomic_init(volatile atomic_schar*, signed char); |
| 3445 | void atomic_init(atomic_schar*, signed char); |
| 3446 | void atomic_store(volatile atomic_schar*, signed char); |
| 3447 | void atomic_store(atomic_schar*, signed char); |
| 3448 | void atomic_store_explicit(volatile atomic_schar*, signed char, memory_order); |
| 3449 | void atomic_store_explicit(atomic_schar*, signed char, memory_order); |
| 3450 | signed char atomic_load(const volatile atomic_schar*); |
| 3451 | signed char atomic_load(const atomic_schar*); |
| 3452 | signed char atomic_load_explicit(const volatile atomic_schar*, memory_order); |
| 3453 | signed char atomic_load_explicit(const atomic_schar*, memory_order); |
| 3454 | signed char atomic_exchange(volatile atomic_schar*, signed char); |
| 3455 | signed char atomic_exchange(atomic_schar*, signed char); |
| 3456 | signed char atomic_exchange_explicit(volatile atomic_schar*, signed char, |
| 3457 | memory_order); |
| 3458 | signed char atomic_exchange_explicit(atomic_schar*, signed char, memory_order); |
| 3459 | bool atomic_compare_exchange_weak(volatile atomic_schar*, signed char*, |
| 3460 | signed char); |
| 3461 | bool atomic_compare_exchange_weak(atomic_schar*, signed char*, signed char); |
| 3462 | bool atomic_compare_exchange_strong(volatile atomic_schar*, signed char*, |
| 3463 | signed char); |
| 3464 | bool atomic_compare_exchange_strong(atomic_schar*, signed char*, signed char); |
| 3465 | bool atomic_compare_exchange_weak_explicit(volatile atomic_schar*, signed char*, |
| 3466 | signed char, memory_order, |
| 3467 | memory_order); |
| 3468 | bool atomic_compare_exchange_weak_explicit(atomic_schar*, signed char*, |
| 3469 | signed char, memory_order, |
| 3470 | memory_order); |
| 3471 | bool atomic_compare_exchange_strong_explicit(volatile atomic_schar*, |
| 3472 | signed char*, signed char, |
| 3473 | memory_order, memory_order); |
| 3474 | bool atomic_compare_exchange_strong_explicit(atomic_schar*, signed char*, |
| 3475 | signed char, memory_order, |
| 3476 | memory_order); |
| 3477 | signed char atomic_fetch_add(volatile atomic_schar*, signed char); |
| 3478 | signed char atomic_fetch_add(atomic_schar*, signed char); |
| 3479 | signed char atomic_fetch_add_explicit(volatile atomic_schar*, signed char, |
| 3480 | memory_order); |
| 3481 | signed char atomic_fetch_add_explicit(atomic_schar*, signed char, memory_order); |
| 3482 | signed char atomic_fetch_sub(volatile atomic_schar*, signed char); |
| 3483 | signed char atomic_fetch_sub(atomic_schar*, signed char); |
| 3484 | signed char atomic_fetch_sub_explicit(volatile atomic_schar*, signed char, |
| 3485 | memory_order); |
| 3486 | signed char atomic_fetch_sub_explicit(atomic_schar*, signed char, memory_order); |
| 3487 | signed char atomic_fetch_and(volatile atomic_schar*, signed char); |
| 3488 | signed char atomic_fetch_and(atomic_schar*, signed char); |
| 3489 | signed char atomic_fetch_and_explicit(volatile atomic_schar*, signed char, |
| 3490 | memory_order); |
| 3491 | signed char atomic_fetch_and_explicit(atomic_schar*, signed char, memory_order); |
| 3492 | signed char atomic_fetch_or(volatile atomic_schar*, signed char); |
| 3493 | signed char atomic_fetch_or(atomic_schar*, signed char); |
| 3494 | signed char atomic_fetch_or_explicit(volatile atomic_schar*, signed char, |
| 3495 | memory_order); |
| 3496 | signed char atomic_fetch_or_explicit(atomic_schar*, signed char, memory_order); |
| 3497 | signed char atomic_fetch_xor(volatile atomic_schar*, signed char); |
| 3498 | signed char atomic_fetch_xor(atomic_schar*, signed char); |
| 3499 | signed char atomic_fetch_xor_explicit(volatile atomic_schar*, signed char, |
| 3500 | memory_order); |
| 3501 | signed char atomic_fetch_xor_explicit(atomic_schar*, signed char, memory_order); |
| 3502 | |
| 3503 | typedef struct atomic_schar |
| 3504 | { |
| 3505 | signed char __v_; |
| 3506 | |
| 3507 | _LIBCPP_INLINE_VISIBILITY |
| 3508 | bool is_lock_free() const volatile |
| 3509 | {return atomic_is_lock_free(this);} |
| 3510 | _LIBCPP_INLINE_VISIBILITY |
| 3511 | bool is_lock_free() const |
| 3512 | {return atomic_is_lock_free(this);} |
| 3513 | _LIBCPP_INLINE_VISIBILITY |
| 3514 | void store(signed char __v, |
| 3515 | memory_order __o = memory_order_seq_cst) volatile |
| 3516 | {atomic_store_explicit(this, __v, __o);} |
| 3517 | _LIBCPP_INLINE_VISIBILITY |
| 3518 | void store(signed char __v, memory_order __o = memory_order_seq_cst) |
| 3519 | {atomic_store_explicit(this, __v, __o);} |
| 3520 | _LIBCPP_INLINE_VISIBILITY |
| 3521 | signed char load(memory_order __o = memory_order_seq_cst) const volatile |
| 3522 | {return atomic_load_explicit(this, __o);} |
| 3523 | _LIBCPP_INLINE_VISIBILITY |
| 3524 | signed char load(memory_order __o = memory_order_seq_cst) const |
| 3525 | {return atomic_load_explicit(this, __o);} |
| 3526 | _LIBCPP_INLINE_VISIBILITY |
| 3527 | operator signed char() const volatile |
| 3528 | {return load();} |
| 3529 | _LIBCPP_INLINE_VISIBILITY |
| 3530 | operator signed char() const |
| 3531 | {return load();} |
| 3532 | _LIBCPP_INLINE_VISIBILITY |
| 3533 | signed char exchange(signed char __v, |
| 3534 | memory_order __o = memory_order_seq_cst) volatile |
| 3535 | {return atomic_exchange_explicit(this, __v, __o);} |
| 3536 | _LIBCPP_INLINE_VISIBILITY |
| 3537 | signed char exchange(signed char __v, |
| 3538 | memory_order __o = memory_order_seq_cst) |
| 3539 | {return atomic_exchange_explicit(this, __v, __o);} |
| 3540 | _LIBCPP_INLINE_VISIBILITY |
| 3541 | bool compare_exchange_weak(signed char& __v, signed char __e, |
| 3542 | memory_order __s, memory_order __f) volatile |
| 3543 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 3544 | __f);} |
| 3545 | _LIBCPP_INLINE_VISIBILITY |
| 3546 | bool compare_exchange_weak(signed char& __v, signed char __e, |
| 3547 | memory_order __s, memory_order __f) |
| 3548 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 3549 | __f);} |
| 3550 | _LIBCPP_INLINE_VISIBILITY |
| 3551 | bool compare_exchange_strong(signed char& __v, signed char __e, |
| 3552 | memory_order __s, memory_order __f) volatile |
| 3553 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 3554 | __f);} |
| 3555 | _LIBCPP_INLINE_VISIBILITY |
| 3556 | bool compare_exchange_strong(signed char& __v, signed char __e, |
| 3557 | memory_order __s, memory_order __f) |
| 3558 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 3559 | __f);} |
| 3560 | _LIBCPP_INLINE_VISIBILITY |
| 3561 | bool compare_exchange_weak(signed char& __v, signed char __e, |
| 3562 | memory_order __s = memory_order_seq_cst) volatile |
| 3563 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 3564 | __translate_memory_order(__s));} |
| 3565 | _LIBCPP_INLINE_VISIBILITY |
| 3566 | bool compare_exchange_weak(signed char& __v, signed char __e, |
| 3567 | memory_order __s = memory_order_seq_cst) |
| 3568 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 3569 | __translate_memory_order(__s));} |
| 3570 | _LIBCPP_INLINE_VISIBILITY |
| 3571 | bool compare_exchange_strong(signed char& __v, signed char __e, |
| 3572 | memory_order __s = memory_order_seq_cst) volatile |
| 3573 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 3574 | __translate_memory_order(__s));} |
| 3575 | _LIBCPP_INLINE_VISIBILITY |
| 3576 | bool compare_exchange_strong(signed char& __v, signed char __e, |
| 3577 | memory_order __s = memory_order_seq_cst) |
| 3578 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 3579 | __translate_memory_order(__s));} |
| 3580 | _LIBCPP_INLINE_VISIBILITY |
| 3581 | signed char fetch_add(signed char __v, |
| 3582 | memory_order __o = memory_order_seq_cst) volatile |
| 3583 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 3584 | _LIBCPP_INLINE_VISIBILITY |
| 3585 | signed char fetch_add(signed char __v, |
| 3586 | memory_order __o = memory_order_seq_cst) |
| 3587 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 3588 | _LIBCPP_INLINE_VISIBILITY |
| 3589 | signed char fetch_sub(signed char __v, |
| 3590 | memory_order __o = memory_order_seq_cst) volatile |
| 3591 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 3592 | _LIBCPP_INLINE_VISIBILITY |
| 3593 | signed char fetch_sub(signed char __v, |
| 3594 | memory_order __o = memory_order_seq_cst) |
| 3595 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 3596 | _LIBCPP_INLINE_VISIBILITY |
| 3597 | signed char fetch_and(signed char __v, |
| 3598 | memory_order __o = memory_order_seq_cst) volatile |
| 3599 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 3600 | _LIBCPP_INLINE_VISIBILITY |
| 3601 | signed char fetch_and(signed char __v, |
| 3602 | memory_order __o = memory_order_seq_cst) |
| 3603 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 3604 | _LIBCPP_INLINE_VISIBILITY |
| 3605 | signed char fetch_or(signed char __v, |
| 3606 | memory_order __o = memory_order_seq_cst) volatile |
| 3607 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 3608 | _LIBCPP_INLINE_VISIBILITY |
| 3609 | signed char fetch_or(signed char __v, |
| 3610 | memory_order __o = memory_order_seq_cst) |
| 3611 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 3612 | _LIBCPP_INLINE_VISIBILITY |
| 3613 | signed char fetch_xor(signed char __v, |
| 3614 | memory_order __o = memory_order_seq_cst) volatile |
| 3615 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 3616 | _LIBCPP_INLINE_VISIBILITY |
| 3617 | signed char fetch_xor(signed char __v, |
| 3618 | memory_order __o = memory_order_seq_cst) |
| 3619 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 3620 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 3621 | atomic_schar() = default; |
| 3622 | #else |
| 3623 | _LIBCPP_INLINE_VISIBILITY |
| 3624 | atomic_schar() {} |
| 3625 | #endif |
| 3626 | _LIBCPP_INLINE_VISIBILITY |
| 3627 | /*constexpr*/ atomic_schar(signed char __v) |
| 3628 | : __v_(__v) {} |
| 3629 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 3630 | atomic_schar(const atomic_schar&) = delete; |
| 3631 | atomic_schar& operator=(const atomic_schar&) = delete; |
| 3632 | atomic_schar& operator=(const atomic_schar&) volatile = delete; |
| 3633 | #else |
| 3634 | private: |
| 3635 | atomic_schar(const atomic_schar&); |
| 3636 | atomic_schar& operator=(const atomic_schar&); |
| 3637 | atomic_schar& operator=(const atomic_schar&) volatile; |
| 3638 | public: |
| 3639 | #endif |
| 3640 | _LIBCPP_INLINE_VISIBILITY |
| 3641 | signed char operator=(signed char __v) volatile |
| 3642 | {store(__v); return __v;} |
| 3643 | _LIBCPP_INLINE_VISIBILITY |
| 3644 | signed char operator=(signed char __v) |
| 3645 | {store(__v); return __v;} |
| 3646 | _LIBCPP_INLINE_VISIBILITY |
| 3647 | signed char operator++(int) volatile |
| 3648 | {typedef signed char type; return fetch_add(type(1));} |
| 3649 | _LIBCPP_INLINE_VISIBILITY |
| 3650 | char operator++(int) |
| 3651 | {typedef signed char type; return fetch_add(type(1));} |
| 3652 | _LIBCPP_INLINE_VISIBILITY |
| 3653 | char operator--(int) volatile |
| 3654 | {typedef signed char type; return fetch_sub(type(1));} |
| 3655 | _LIBCPP_INLINE_VISIBILITY |
| 3656 | char operator--(int) |
| 3657 | {typedef signed char type; return fetch_sub(type(1));} |
| 3658 | _LIBCPP_INLINE_VISIBILITY |
| 3659 | char operator++() volatile |
| 3660 | {typedef signed char type; return type(fetch_add(type(1)) + 1);} |
| 3661 | _LIBCPP_INLINE_VISIBILITY |
| 3662 | char operator++() |
| 3663 | {typedef signed char type; return type(fetch_add(type(1)) + 1);} |
| 3664 | _LIBCPP_INLINE_VISIBILITY |
| 3665 | char operator--() volatile |
| 3666 | {typedef signed char type; return type(fetch_sub(type(1)) - 1);} |
| 3667 | _LIBCPP_INLINE_VISIBILITY |
| 3668 | char operator--() |
| 3669 | {typedef signed char type; return type(fetch_sub(type(1)) - 1);} |
| 3670 | _LIBCPP_INLINE_VISIBILITY |
| 3671 | char operator+=(char __v) volatile |
| 3672 | {typedef signed char type; return type(fetch_add(__v) + __v);} |
| 3673 | _LIBCPP_INLINE_VISIBILITY |
| 3674 | char operator+=(char __v) |
| 3675 | {typedef signed char type; return type(fetch_add(__v) + __v);} |
| 3676 | _LIBCPP_INLINE_VISIBILITY |
| 3677 | char operator-=(char __v) volatile |
| 3678 | {typedef signed char type; return type(fetch_sub(__v) - __v);} |
| 3679 | _LIBCPP_INLINE_VISIBILITY |
| 3680 | char operator-=(char __v) |
| 3681 | {typedef signed char type; return type(fetch_sub(__v) - __v);} |
| 3682 | _LIBCPP_INLINE_VISIBILITY |
| 3683 | char operator&=(char __v) volatile |
| 3684 | {typedef signed char type; return type(fetch_and(__v) & __v);} |
| 3685 | _LIBCPP_INLINE_VISIBILITY |
| 3686 | char operator&=(char __v) |
| 3687 | {typedef signed char type; return type(fetch_and(__v) & __v);} |
| 3688 | _LIBCPP_INLINE_VISIBILITY |
| 3689 | char operator|=(char __v) volatile |
| 3690 | {typedef signed char type; return type(fetch_or(__v) | __v);} |
| 3691 | _LIBCPP_INLINE_VISIBILITY |
| 3692 | char operator|=(char __v) |
| 3693 | {typedef signed char type; return type(fetch_or(__v) | __v);} |
| 3694 | _LIBCPP_INLINE_VISIBILITY |
| 3695 | char operator^=(char __v) volatile |
| 3696 | {typedef signed char type; return type(fetch_xor(__v) ^ __v);} |
| 3697 | _LIBCPP_INLINE_VISIBILITY |
| 3698 | char operator^=(char __v) |
| 3699 | {typedef signed char type; return type(fetch_xor(__v) ^ __v);} |
| 3700 | } atomic_schar; |
| 3701 | |
| 3702 | inline _LIBCPP_INLINE_VISIBILITY |
| 3703 | bool |
| 3704 | atomic_is_lock_free(const volatile atomic_schar*) |
| 3705 | { |
| 3706 | typedef signed char type; |
| 3707 | return __atomic_is_lock_free(type); |
| 3708 | } |
| 3709 | |
| 3710 | inline _LIBCPP_INLINE_VISIBILITY |
| 3711 | bool |
| 3712 | atomic_is_lock_free(const atomic_schar* __obj) |
| 3713 | { |
| 3714 | return atomic_is_lock_free(const_cast<volatile atomic_schar*>(__obj)); |
| 3715 | } |
| 3716 | |
| 3717 | inline _LIBCPP_INLINE_VISIBILITY |
| 3718 | void |
| 3719 | atomic_init(volatile atomic_schar* __obj, signed char __desr) |
| 3720 | { |
| 3721 | __obj->__v_ = __desr; |
| 3722 | } |
| 3723 | |
| 3724 | inline _LIBCPP_INLINE_VISIBILITY |
| 3725 | void |
| 3726 | atomic_init(atomic_schar* __obj, signed char __desr) |
| 3727 | { |
| 3728 | __obj->__v_ = __desr; |
| 3729 | } |
| 3730 | |
| 3731 | inline _LIBCPP_INLINE_VISIBILITY |
| 3732 | void |
| 3733 | atomic_store(volatile atomic_schar* __obj, signed char __desr) |
| 3734 | { |
| 3735 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 3736 | } |
| 3737 | |
| 3738 | inline _LIBCPP_INLINE_VISIBILITY |
| 3739 | void |
| 3740 | atomic_store(atomic_schar* __obj, signed char __desr) |
| 3741 | { |
| 3742 | atomic_store(const_cast<volatile atomic_schar*>(__obj), __desr); |
| 3743 | } |
| 3744 | |
| 3745 | inline _LIBCPP_INLINE_VISIBILITY |
| 3746 | void |
| 3747 | atomic_store_explicit(volatile atomic_schar* __obj, signed char __desr, |
| 3748 | memory_order __o) |
| 3749 | { |
| 3750 | __atomic_store(&__obj->__v_, __desr, __o); |
| 3751 | } |
| 3752 | |
| 3753 | inline _LIBCPP_INLINE_VISIBILITY |
| 3754 | void |
| 3755 | atomic_store_explicit(atomic_schar* __obj, signed char __desr, memory_order __o) |
| 3756 | { |
| 3757 | atomic_store_explicit(const_cast<volatile atomic_schar*>(__obj), __desr, |
| 3758 | __o); |
| 3759 | } |
| 3760 | |
| 3761 | inline _LIBCPP_INLINE_VISIBILITY |
| 3762 | signed char |
| 3763 | atomic_load(const volatile atomic_schar* __obj) |
| 3764 | { |
| 3765 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 3766 | } |
| 3767 | |
| 3768 | inline _LIBCPP_INLINE_VISIBILITY |
| 3769 | signed char |
| 3770 | atomic_load(const atomic_schar* __obj) |
| 3771 | { |
| 3772 | return atomic_load(const_cast<const volatile atomic_schar*>(__obj)); |
| 3773 | } |
| 3774 | |
| 3775 | inline _LIBCPP_INLINE_VISIBILITY |
| 3776 | signed char |
| 3777 | atomic_load_explicit(const volatile atomic_schar* __obj, memory_order __o) |
| 3778 | { |
| 3779 | return __atomic_load(&__obj->__v_, __o); |
| 3780 | } |
| 3781 | |
| 3782 | inline _LIBCPP_INLINE_VISIBILITY |
| 3783 | signed char |
| 3784 | atomic_load_explicit(const atomic_schar* __obj, memory_order __o) |
| 3785 | { |
| 3786 | return atomic_load_explicit(const_cast<const volatile atomic_schar*> |
| 3787 | (__obj), __o); |
| 3788 | } |
| 3789 | |
| 3790 | inline _LIBCPP_INLINE_VISIBILITY |
| 3791 | signed char |
| 3792 | atomic_exchange(volatile atomic_schar* __obj, signed char __desr) |
| 3793 | { |
| 3794 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 3795 | } |
| 3796 | |
| 3797 | inline _LIBCPP_INLINE_VISIBILITY |
| 3798 | signed char |
| 3799 | atomic_exchange(atomic_schar* __obj, signed char __desr) |
| 3800 | { |
| 3801 | return atomic_exchange(const_cast<volatile atomic_schar*>(__obj), __desr); |
| 3802 | } |
| 3803 | |
| 3804 | inline _LIBCPP_INLINE_VISIBILITY |
| 3805 | signed char |
| 3806 | atomic_exchange_explicit(volatile atomic_schar* __obj, signed char __desr, |
| 3807 | memory_order __o) |
| 3808 | { |
| 3809 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 3810 | } |
| 3811 | |
| 3812 | inline _LIBCPP_INLINE_VISIBILITY |
| 3813 | signed char |
| 3814 | atomic_exchange_explicit(atomic_schar* __obj, signed char __desr, |
| 3815 | memory_order __o) |
| 3816 | { |
| 3817 | return atomic_exchange_explicit(const_cast<volatile atomic_schar*> |
| 3818 | (__obj), __desr, __o); |
| 3819 | } |
| 3820 | |
| 3821 | inline _LIBCPP_INLINE_VISIBILITY |
| 3822 | bool |
| 3823 | atomic_compare_exchange_weak(volatile atomic_schar* __obj, signed char* __exp, |
| 3824 | signed char __desr) |
| 3825 | { |
| 3826 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 3827 | memory_order_seq_cst, memory_order_seq_cst); |
| 3828 | } |
| 3829 | |
| 3830 | inline _LIBCPP_INLINE_VISIBILITY |
| 3831 | bool |
| 3832 | atomic_compare_exchange_weak(atomic_schar* __obj, signed char* __exp, |
| 3833 | signed char __desr) |
| 3834 | { |
| 3835 | return atomic_compare_exchange_weak(const_cast<volatile atomic_schar*> |
| 3836 | (__obj), __exp, __desr); |
| 3837 | } |
| 3838 | |
| 3839 | inline _LIBCPP_INLINE_VISIBILITY |
| 3840 | bool |
| 3841 | atomic_compare_exchange_strong(volatile atomic_schar* __obj, signed char* __exp, |
| 3842 | signed char __desr) |
| 3843 | { |
| 3844 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 3845 | memory_order_seq_cst, memory_order_seq_cst); |
| 3846 | } |
| 3847 | |
| 3848 | inline _LIBCPP_INLINE_VISIBILITY |
| 3849 | bool |
| 3850 | atomic_compare_exchange_strong(atomic_schar* __obj, signed char* __exp, |
| 3851 | signed char __desr) |
| 3852 | { |
| 3853 | return atomic_compare_exchange_strong(const_cast<volatile atomic_schar*> |
| 3854 | (__obj), __exp, __desr); |
| 3855 | } |
| 3856 | |
| 3857 | inline _LIBCPP_INLINE_VISIBILITY |
| 3858 | bool |
| 3859 | atomic_compare_exchange_weak_explicit(volatile atomic_schar* __obj, |
| 3860 | signed char* __exp, signed char __desr, |
| 3861 | memory_order __s, memory_order __f) |
| 3862 | { |
| 3863 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 3864 | __f); |
| 3865 | } |
| 3866 | |
| 3867 | inline _LIBCPP_INLINE_VISIBILITY |
| 3868 | bool |
| 3869 | atomic_compare_exchange_weak_explicit(atomic_schar* __obj, signed char* __exp, |
| 3870 | signed char __desr, memory_order __s, |
| 3871 | memory_order __f) |
| 3872 | { |
| 3873 | return atomic_compare_exchange_weak_explicit( |
| 3874 | const_cast<volatile atomic_schar*>(__obj), __exp, __desr, __s, __f); |
| 3875 | } |
| 3876 | |
| 3877 | inline _LIBCPP_INLINE_VISIBILITY |
| 3878 | bool |
| 3879 | atomic_compare_exchange_strong_explicit(volatile atomic_schar* __obj, |
| 3880 | signed char* __exp, signed char __desr, |
| 3881 | memory_order __s, memory_order __f) |
| 3882 | { |
| 3883 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 3884 | __f); |
| 3885 | } |
| 3886 | |
| 3887 | inline _LIBCPP_INLINE_VISIBILITY |
| 3888 | bool |
| 3889 | atomic_compare_exchange_strong_explicit(atomic_schar* __obj, signed char* __exp, |
| 3890 | signed char __desr, memory_order __s, |
| 3891 | memory_order __f) |
| 3892 | { |
| 3893 | return atomic_compare_exchange_strong_explicit( |
| 3894 | const_cast<volatile atomic_schar*>(__obj), __exp, __desr, __s, __f); |
| 3895 | } |
| 3896 | |
| 3897 | inline _LIBCPP_INLINE_VISIBILITY |
| 3898 | signed char |
| 3899 | atomic_fetch_add(volatile atomic_schar* __obj, signed char __v) |
| 3900 | { |
| 3901 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 3902 | } |
| 3903 | |
| 3904 | inline _LIBCPP_INLINE_VISIBILITY |
| 3905 | signed char |
| 3906 | atomic_fetch_add(atomic_schar* __obj, signed char __v) |
| 3907 | { |
| 3908 | return atomic_fetch_add(const_cast<volatile atomic_schar*>(__obj), __v); |
| 3909 | } |
| 3910 | |
| 3911 | inline _LIBCPP_INLINE_VISIBILITY |
| 3912 | signed char |
| 3913 | atomic_fetch_add_explicit(volatile atomic_schar* __obj, signed char __v, |
| 3914 | memory_order __o) |
| 3915 | { |
| 3916 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 3917 | } |
| 3918 | |
| 3919 | inline _LIBCPP_INLINE_VISIBILITY |
| 3920 | signed char |
| 3921 | atomic_fetch_add_explicit(atomic_schar* __obj, signed char __v, |
| 3922 | memory_order __o) |
| 3923 | { |
| 3924 | return atomic_fetch_add_explicit(const_cast<volatile atomic_schar*>(__obj), |
| 3925 | __v, __o); |
| 3926 | } |
| 3927 | |
| 3928 | inline _LIBCPP_INLINE_VISIBILITY |
| 3929 | signed char |
| 3930 | atomic_fetch_sub(volatile atomic_schar* __obj, signed char __v) |
| 3931 | { |
| 3932 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 3933 | } |
| 3934 | |
| 3935 | inline _LIBCPP_INLINE_VISIBILITY |
| 3936 | signed char |
| 3937 | atomic_fetch_sub(atomic_schar* __obj, signed char __v) |
| 3938 | { |
| 3939 | return atomic_fetch_sub(const_cast<volatile atomic_schar*>(__obj), __v); |
| 3940 | } |
| 3941 | |
| 3942 | inline _LIBCPP_INLINE_VISIBILITY |
| 3943 | signed char |
| 3944 | atomic_fetch_sub_explicit(volatile atomic_schar* __obj, signed char __v, |
| 3945 | memory_order __o) |
| 3946 | { |
| 3947 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 3948 | } |
| 3949 | |
| 3950 | inline _LIBCPP_INLINE_VISIBILITY |
| 3951 | signed char |
| 3952 | atomic_fetch_sub_explicit(atomic_schar* __obj, signed char __v, |
| 3953 | memory_order __o) |
| 3954 | { |
| 3955 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_schar*>(__obj), |
| 3956 | __v, __o); |
| 3957 | } |
| 3958 | |
| 3959 | inline _LIBCPP_INLINE_VISIBILITY |
| 3960 | signed char |
| 3961 | atomic_fetch_and(volatile atomic_schar* __obj, signed char __v) |
| 3962 | { |
| 3963 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 3964 | } |
| 3965 | |
| 3966 | inline _LIBCPP_INLINE_VISIBILITY |
| 3967 | signed char |
| 3968 | atomic_fetch_and(atomic_schar* __obj, signed char __v) |
| 3969 | { |
| 3970 | return atomic_fetch_and(const_cast<volatile atomic_schar*>(__obj), __v); |
| 3971 | } |
| 3972 | |
| 3973 | inline _LIBCPP_INLINE_VISIBILITY |
| 3974 | signed char |
| 3975 | atomic_fetch_and_explicit(volatile atomic_schar* __obj, signed char __v, |
| 3976 | memory_order __o) |
| 3977 | { |
| 3978 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 3979 | } |
| 3980 | |
| 3981 | inline _LIBCPP_INLINE_VISIBILITY |
| 3982 | signed char |
| 3983 | atomic_fetch_and_explicit(atomic_schar* __obj, signed char __v, |
| 3984 | memory_order __o) |
| 3985 | { |
| 3986 | return atomic_fetch_and_explicit(const_cast<volatile atomic_schar*>(__obj), |
| 3987 | __v, __o); |
| 3988 | } |
| 3989 | |
| 3990 | inline _LIBCPP_INLINE_VISIBILITY |
| 3991 | signed char |
| 3992 | atomic_fetch_or(volatile atomic_schar* __obj, signed char __v) |
| 3993 | { |
| 3994 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 3995 | } |
| 3996 | |
| 3997 | inline _LIBCPP_INLINE_VISIBILITY |
| 3998 | signed char |
| 3999 | atomic_fetch_or(atomic_schar* __obj, signed char __v) |
| 4000 | { |
| 4001 | return atomic_fetch_or(const_cast<volatile atomic_schar*>(__obj), __v); |
| 4002 | } |
| 4003 | |
| 4004 | inline _LIBCPP_INLINE_VISIBILITY |
| 4005 | signed char |
| 4006 | atomic_fetch_or_explicit(volatile atomic_schar* __obj, signed char __v, |
| 4007 | memory_order __o) |
| 4008 | { |
| 4009 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 4010 | } |
| 4011 | |
| 4012 | inline _LIBCPP_INLINE_VISIBILITY |
| 4013 | signed char |
| 4014 | atomic_fetch_or_explicit(atomic_schar* __obj, signed char __v, memory_order __o) |
| 4015 | { |
| 4016 | return atomic_fetch_or_explicit(const_cast<volatile atomic_schar*>(__obj), |
| 4017 | __v, __o); |
| 4018 | } |
| 4019 | |
| 4020 | inline _LIBCPP_INLINE_VISIBILITY |
| 4021 | signed char |
| 4022 | atomic_fetch_xor(volatile atomic_schar* __obj, signed char __v) |
| 4023 | { |
| 4024 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 4025 | } |
| 4026 | |
| 4027 | inline _LIBCPP_INLINE_VISIBILITY |
| 4028 | signed char |
| 4029 | atomic_fetch_xor(atomic_schar* __obj, signed char __v) |
| 4030 | { |
| 4031 | return atomic_fetch_xor(const_cast<volatile atomic_schar*>(__obj), __v); |
| 4032 | } |
| 4033 | |
| 4034 | inline _LIBCPP_INLINE_VISIBILITY |
| 4035 | signed char |
| 4036 | atomic_fetch_xor_explicit(volatile atomic_schar* __obj, signed char __v, |
| 4037 | memory_order __o) |
| 4038 | { |
| 4039 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 4040 | } |
| 4041 | |
| 4042 | inline _LIBCPP_INLINE_VISIBILITY |
| 4043 | signed char |
| 4044 | atomic_fetch_xor_explicit(atomic_schar* __obj, signed char __v, |
| 4045 | memory_order __o) |
| 4046 | { |
| 4047 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_schar*>(__obj), |
| 4048 | __v, __o); |
| 4049 | } |
| 4050 | |
| 4051 | // atomic_uchar |
| 4052 | |
| 4053 | struct atomic_uchar; |
| 4054 | |
| 4055 | bool atomic_is_lock_free(const volatile atomic_uchar*); |
| 4056 | bool atomic_is_lock_free(const atomic_uchar*); |
| 4057 | void atomic_init(volatile atomic_uchar*, unsigned char); |
| 4058 | void atomic_init(atomic_uchar*, unsigned char); |
| 4059 | void atomic_store(volatile atomic_uchar*, unsigned char); |
| 4060 | void atomic_store(atomic_uchar*, unsigned char); |
| 4061 | void atomic_store_explicit(volatile atomic_uchar*, unsigned char, memory_order); |
| 4062 | void atomic_store_explicit(atomic_uchar*, unsigned char, memory_order); |
| 4063 | unsigned char atomic_load(const volatile atomic_uchar*); |
| 4064 | unsigned char atomic_load(const atomic_uchar*); |
| 4065 | unsigned char atomic_load_explicit(const volatile atomic_uchar*, memory_order); |
| 4066 | unsigned char atomic_load_explicit(const atomic_uchar*, memory_order); |
| 4067 | unsigned char atomic_exchange(volatile atomic_uchar*, unsigned char); |
| 4068 | unsigned char atomic_exchange(atomic_uchar*, unsigned char); |
| 4069 | unsigned char atomic_exchange_explicit(volatile atomic_uchar*, unsigned char, |
| 4070 | memory_order); |
| 4071 | unsigned char atomic_exchange_explicit(atomic_uchar*, unsigned char, |
| 4072 | memory_order); |
| 4073 | bool atomic_compare_exchange_weak(volatile atomic_uchar*, unsigned char*, |
| 4074 | unsigned char); |
| 4075 | bool atomic_compare_exchange_weak(atomic_uchar*, unsigned char*, unsigned char); |
| 4076 | bool atomic_compare_exchange_strong(volatile atomic_uchar*, unsigned char*, |
| 4077 | unsigned char); |
| 4078 | bool atomic_compare_exchange_strong(atomic_uchar*, unsigned char*, |
| 4079 | unsigned char); |
| 4080 | bool atomic_compare_exchange_weak_explicit(volatile atomic_uchar*, |
| 4081 | unsigned char*, unsigned char, |
| 4082 | memory_order, memory_order); |
| 4083 | bool atomic_compare_exchange_weak_explicit(atomic_uchar*, unsigned char*, |
| 4084 | unsigned char, memory_order, |
| 4085 | memory_order); |
| 4086 | bool atomic_compare_exchange_strong_explicit(volatile atomic_uchar*, |
| 4087 | unsigned char*, unsigned char, |
| 4088 | memory_order, memory_order); |
| 4089 | bool atomic_compare_exchange_strong_explicit(atomic_uchar*, unsigned char*, |
| 4090 | unsigned char, memory_order, |
| 4091 | memory_order); |
| 4092 | unsigned char atomic_fetch_add(volatile atomic_uchar*, unsigned char); |
| 4093 | unsigned char atomic_fetch_add(atomic_uchar*, unsigned char); |
| 4094 | unsigned char atomic_fetch_add_explicit(volatile atomic_uchar*, unsigned char, |
| 4095 | memory_order); |
| 4096 | unsigned char atomic_fetch_add_explicit(atomic_uchar*, unsigned char, |
| 4097 | memory_order); |
| 4098 | unsigned char atomic_fetch_sub(volatile atomic_uchar*, unsigned char); |
| 4099 | unsigned char atomic_fetch_sub(atomic_uchar*, unsigned char); |
| 4100 | unsigned char atomic_fetch_sub_explicit(volatile atomic_uchar*, unsigned char, |
| 4101 | memory_order); |
| 4102 | unsigned char atomic_fetch_sub_explicit(atomic_uchar*, unsigned char, |
| 4103 | memory_order); |
| 4104 | unsigned char atomic_fetch_and(volatile atomic_uchar*, unsigned char); |
| 4105 | unsigned char atomic_fetch_and(atomic_uchar*, unsigned char); |
| 4106 | unsigned char atomic_fetch_and_explicit(volatile atomic_uchar*, unsigned char, |
| 4107 | memory_order); |
| 4108 | unsigned char atomic_fetch_and_explicit(atomic_uchar*, unsigned char, |
| 4109 | memory_order); |
| 4110 | unsigned char atomic_fetch_or(volatile atomic_uchar*, unsigned char); |
| 4111 | unsigned char atomic_fetch_or(atomic_uchar*, unsigned char); |
| 4112 | unsigned char atomic_fetch_or_explicit(volatile atomic_uchar*, unsigned char, |
| 4113 | memory_order); |
| 4114 | unsigned char atomic_fetch_or_explicit(atomic_uchar*, unsigned char, |
| 4115 | memory_order); |
| 4116 | unsigned char atomic_fetch_xor(volatile atomic_uchar*, unsigned char); |
| 4117 | unsigned char atomic_fetch_xor(atomic_uchar*, unsigned char); |
| 4118 | unsigned char atomic_fetch_xor_explicit(volatile atomic_uchar*, unsigned char, |
| 4119 | memory_order); |
| 4120 | unsigned char atomic_fetch_xor_explicit(atomic_uchar*, unsigned char, |
| 4121 | memory_order); |
| 4122 | |
| 4123 | typedef struct atomic_uchar |
| 4124 | { |
| 4125 | unsigned char __v_; |
| 4126 | |
| 4127 | _LIBCPP_INLINE_VISIBILITY |
| 4128 | bool is_lock_free() const volatile |
| 4129 | {return atomic_is_lock_free(this);} |
| 4130 | _LIBCPP_INLINE_VISIBILITY |
| 4131 | bool is_lock_free() const |
| 4132 | {return atomic_is_lock_free(this);} |
| 4133 | _LIBCPP_INLINE_VISIBILITY |
| 4134 | void store(unsigned char __v, |
| 4135 | memory_order __o = memory_order_seq_cst) volatile |
| 4136 | {atomic_store_explicit(this, __v, __o);} |
| 4137 | _LIBCPP_INLINE_VISIBILITY |
| 4138 | void store(unsigned char __v, memory_order __o = memory_order_seq_cst) |
| 4139 | {atomic_store_explicit(this, __v, __o);} |
| 4140 | _LIBCPP_INLINE_VISIBILITY |
| 4141 | unsigned char load(memory_order __o = memory_order_seq_cst) const volatile |
| 4142 | {return atomic_load_explicit(this, __o);} |
| 4143 | _LIBCPP_INLINE_VISIBILITY |
| 4144 | unsigned char load(memory_order __o = memory_order_seq_cst) const |
| 4145 | {return atomic_load_explicit(this, __o);} |
| 4146 | _LIBCPP_INLINE_VISIBILITY |
| 4147 | operator unsigned char() const volatile |
| 4148 | {return load();} |
| 4149 | _LIBCPP_INLINE_VISIBILITY |
| 4150 | operator unsigned char() const |
| 4151 | {return load();} |
| 4152 | _LIBCPP_INLINE_VISIBILITY |
| 4153 | unsigned char exchange(unsigned char __v, |
| 4154 | memory_order __o = memory_order_seq_cst) volatile |
| 4155 | {return atomic_exchange_explicit(this, __v, __o);} |
| 4156 | _LIBCPP_INLINE_VISIBILITY |
| 4157 | unsigned char exchange(unsigned char __v, |
| 4158 | memory_order __o = memory_order_seq_cst) |
| 4159 | {return atomic_exchange_explicit(this, __v, __o);} |
| 4160 | _LIBCPP_INLINE_VISIBILITY |
| 4161 | bool compare_exchange_weak(unsigned char& __v, unsigned char __e, |
| 4162 | memory_order __s, memory_order __f) volatile |
| 4163 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4164 | __f);} |
| 4165 | _LIBCPP_INLINE_VISIBILITY |
| 4166 | bool compare_exchange_weak(unsigned char& __v, unsigned char __e, |
| 4167 | memory_order __s, memory_order __f) |
| 4168 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4169 | __f);} |
| 4170 | _LIBCPP_INLINE_VISIBILITY |
| 4171 | bool compare_exchange_strong(unsigned char& __v, unsigned char __e, |
| 4172 | memory_order __s, memory_order __f) volatile |
| 4173 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4174 | __f);} |
| 4175 | _LIBCPP_INLINE_VISIBILITY |
| 4176 | bool compare_exchange_strong(unsigned char& __v, unsigned char __e, |
| 4177 | memory_order __s, memory_order __f) |
| 4178 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4179 | __f);} |
| 4180 | _LIBCPP_INLINE_VISIBILITY |
| 4181 | bool compare_exchange_weak(unsigned char& __v, unsigned char __e, |
| 4182 | memory_order __s = memory_order_seq_cst) volatile |
| 4183 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4184 | __translate_memory_order(__s));} |
| 4185 | _LIBCPP_INLINE_VISIBILITY |
| 4186 | bool compare_exchange_weak(unsigned char& __v, unsigned char __e, |
| 4187 | memory_order __s = memory_order_seq_cst) |
| 4188 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4189 | __translate_memory_order(__s));} |
| 4190 | _LIBCPP_INLINE_VISIBILITY |
| 4191 | bool compare_exchange_strong(unsigned char& __v, unsigned char __e, |
| 4192 | memory_order __s = memory_order_seq_cst) volatile |
| 4193 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4194 | __translate_memory_order(__s));} |
| 4195 | _LIBCPP_INLINE_VISIBILITY |
| 4196 | bool compare_exchange_strong(unsigned char& __v, unsigned char __e, |
| 4197 | memory_order __s = memory_order_seq_cst) |
| 4198 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4199 | __translate_memory_order(__s));} |
| 4200 | _LIBCPP_INLINE_VISIBILITY |
| 4201 | unsigned char fetch_add(unsigned char __v, |
| 4202 | memory_order __o = memory_order_seq_cst) volatile |
| 4203 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 4204 | _LIBCPP_INLINE_VISIBILITY |
| 4205 | unsigned char fetch_add(unsigned char __v, |
| 4206 | memory_order __o = memory_order_seq_cst) |
| 4207 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 4208 | _LIBCPP_INLINE_VISIBILITY |
| 4209 | unsigned char fetch_sub(unsigned char __v, |
| 4210 | memory_order __o = memory_order_seq_cst) volatile |
| 4211 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 4212 | _LIBCPP_INLINE_VISIBILITY |
| 4213 | unsigned char fetch_sub(unsigned char __v, |
| 4214 | memory_order __o = memory_order_seq_cst) |
| 4215 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 4216 | _LIBCPP_INLINE_VISIBILITY |
| 4217 | unsigned char fetch_and(unsigned char __v, |
| 4218 | memory_order __o = memory_order_seq_cst) volatile |
| 4219 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 4220 | _LIBCPP_INLINE_VISIBILITY |
| 4221 | unsigned char fetch_and(unsigned char __v, |
| 4222 | memory_order __o = memory_order_seq_cst) |
| 4223 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 4224 | _LIBCPP_INLINE_VISIBILITY |
| 4225 | unsigned char fetch_or(unsigned char __v, |
| 4226 | memory_order __o = memory_order_seq_cst) volatile |
| 4227 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 4228 | _LIBCPP_INLINE_VISIBILITY |
| 4229 | unsigned char fetch_or(unsigned char __v, |
| 4230 | memory_order __o = memory_order_seq_cst) |
| 4231 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 4232 | _LIBCPP_INLINE_VISIBILITY |
| 4233 | unsigned char fetch_xor(unsigned char __v, |
| 4234 | memory_order __o = memory_order_seq_cst) volatile |
| 4235 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 4236 | _LIBCPP_INLINE_VISIBILITY |
| 4237 | unsigned char fetch_xor(unsigned char __v, |
| 4238 | memory_order __o = memory_order_seq_cst) |
| 4239 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 4240 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 4241 | atomic_uchar() = default; |
| 4242 | #else |
| 4243 | _LIBCPP_INLINE_VISIBILITY |
| 4244 | atomic_uchar() {} |
| 4245 | #endif |
| 4246 | _LIBCPP_INLINE_VISIBILITY |
| 4247 | /*constexpr*/ atomic_uchar(unsigned char __v) |
| 4248 | : __v_(__v) {} |
| 4249 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 4250 | atomic_uchar(const atomic_uchar&) = delete; |
| 4251 | atomic_uchar& operator=(const atomic_uchar&) = delete; |
| 4252 | atomic_uchar& operator=(const atomic_uchar&) volatile = delete; |
| 4253 | #else |
| 4254 | private: |
| 4255 | atomic_uchar(const atomic_uchar&); |
| 4256 | atomic_uchar& operator=(const atomic_uchar&); |
| 4257 | atomic_uchar& operator=(const atomic_uchar&) volatile; |
| 4258 | public: |
| 4259 | #endif |
| 4260 | _LIBCPP_INLINE_VISIBILITY |
| 4261 | unsigned char operator=(unsigned char __v) volatile |
| 4262 | {store(__v); return __v;} |
| 4263 | _LIBCPP_INLINE_VISIBILITY |
| 4264 | unsigned char operator=(unsigned char __v) |
| 4265 | {store(__v); return __v;} |
| 4266 | _LIBCPP_INLINE_VISIBILITY |
| 4267 | unsigned char operator++(int) volatile |
| 4268 | {typedef unsigned char type; return fetch_add(type(1));} |
| 4269 | _LIBCPP_INLINE_VISIBILITY |
| 4270 | char operator++(int) |
| 4271 | {typedef unsigned char type; return fetch_add(type(1));} |
| 4272 | _LIBCPP_INLINE_VISIBILITY |
| 4273 | char operator--(int) volatile |
| 4274 | {typedef unsigned char type; return fetch_sub(type(1));} |
| 4275 | _LIBCPP_INLINE_VISIBILITY |
| 4276 | char operator--(int) |
| 4277 | {typedef unsigned char type; return fetch_sub(type(1));} |
| 4278 | _LIBCPP_INLINE_VISIBILITY |
| 4279 | char operator++() volatile |
| 4280 | {typedef unsigned char type; return type(fetch_add(type(1)) + 1);} |
| 4281 | _LIBCPP_INLINE_VISIBILITY |
| 4282 | char operator++() |
| 4283 | {typedef unsigned char type; return type(fetch_add(type(1)) + 1);} |
| 4284 | _LIBCPP_INLINE_VISIBILITY |
| 4285 | char operator--() volatile |
| 4286 | {typedef unsigned char type; return type(fetch_sub(type(1)) - 1);} |
| 4287 | _LIBCPP_INLINE_VISIBILITY |
| 4288 | char operator--() |
| 4289 | {typedef unsigned char type; return type(fetch_sub(type(1)) - 1);} |
| 4290 | _LIBCPP_INLINE_VISIBILITY |
| 4291 | char operator+=(char __v) volatile |
| 4292 | {typedef unsigned char type; return type(fetch_add(__v) + __v);} |
| 4293 | _LIBCPP_INLINE_VISIBILITY |
| 4294 | char operator+=(char __v) |
| 4295 | {typedef unsigned char type; return type(fetch_add(__v) + __v);} |
| 4296 | _LIBCPP_INLINE_VISIBILITY |
| 4297 | char operator-=(char __v) volatile |
| 4298 | {typedef unsigned char type; return type(fetch_sub(__v) - __v);} |
| 4299 | _LIBCPP_INLINE_VISIBILITY |
| 4300 | char operator-=(char __v) |
| 4301 | {typedef unsigned char type; return type(fetch_sub(__v) - __v);} |
| 4302 | _LIBCPP_INLINE_VISIBILITY |
| 4303 | char operator&=(char __v) volatile |
| 4304 | {typedef unsigned char type; return type(fetch_and(__v) & __v);} |
| 4305 | _LIBCPP_INLINE_VISIBILITY |
| 4306 | char operator&=(char __v) |
| 4307 | {typedef unsigned char type; return type(fetch_and(__v) & __v);} |
| 4308 | _LIBCPP_INLINE_VISIBILITY |
| 4309 | char operator|=(char __v) volatile |
| 4310 | {typedef unsigned char type; return type(fetch_or(__v) | __v);} |
| 4311 | _LIBCPP_INLINE_VISIBILITY |
| 4312 | char operator|=(char __v) |
| 4313 | {typedef unsigned char type; return type(fetch_or(__v) | __v);} |
| 4314 | _LIBCPP_INLINE_VISIBILITY |
| 4315 | char operator^=(char __v) volatile |
| 4316 | {typedef unsigned char type; return type(fetch_xor(__v) ^ __v);} |
| 4317 | _LIBCPP_INLINE_VISIBILITY |
| 4318 | char operator^=(char __v) |
| 4319 | {typedef unsigned char type; return type(fetch_xor(__v) ^ __v);} |
| 4320 | } atomic_uchar; |
| 4321 | |
| 4322 | inline _LIBCPP_INLINE_VISIBILITY |
| 4323 | bool |
| 4324 | atomic_is_lock_free(const volatile atomic_uchar*) |
| 4325 | { |
| 4326 | typedef unsigned char type; |
| 4327 | return __atomic_is_lock_free(type); |
| 4328 | } |
| 4329 | |
| 4330 | inline _LIBCPP_INLINE_VISIBILITY |
| 4331 | bool |
| 4332 | atomic_is_lock_free(const atomic_uchar* __obj) |
| 4333 | { |
| 4334 | return atomic_is_lock_free(const_cast<volatile atomic_uchar*>(__obj)); |
| 4335 | } |
| 4336 | |
| 4337 | inline _LIBCPP_INLINE_VISIBILITY |
| 4338 | void |
| 4339 | atomic_init(volatile atomic_uchar* __obj, unsigned char __desr) |
| 4340 | { |
| 4341 | __obj->__v_ = __desr; |
| 4342 | } |
| 4343 | |
| 4344 | inline _LIBCPP_INLINE_VISIBILITY |
| 4345 | void |
| 4346 | atomic_init(atomic_uchar* __obj, unsigned char __desr) |
| 4347 | { |
| 4348 | __obj->__v_ = __desr; |
| 4349 | } |
| 4350 | |
| 4351 | inline _LIBCPP_INLINE_VISIBILITY |
| 4352 | void |
| 4353 | atomic_store(volatile atomic_uchar* __obj, unsigned char __desr) |
| 4354 | { |
| 4355 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 4356 | } |
| 4357 | |
| 4358 | inline _LIBCPP_INLINE_VISIBILITY |
| 4359 | void |
| 4360 | atomic_store(atomic_uchar* __obj, unsigned char __desr) |
| 4361 | { |
| 4362 | atomic_store(const_cast<volatile atomic_uchar*>(__obj), __desr); |
| 4363 | } |
| 4364 | |
| 4365 | inline _LIBCPP_INLINE_VISIBILITY |
| 4366 | void |
| 4367 | atomic_store_explicit(volatile atomic_uchar* __obj, unsigned char __desr, |
| 4368 | memory_order __o) |
| 4369 | { |
| 4370 | __atomic_store(&__obj->__v_, __desr, __o); |
| 4371 | } |
| 4372 | |
| 4373 | inline _LIBCPP_INLINE_VISIBILITY |
| 4374 | void |
| 4375 | atomic_store_explicit(atomic_uchar* __obj, unsigned char __desr, |
| 4376 | memory_order __o) |
| 4377 | { |
| 4378 | atomic_store_explicit(const_cast<volatile atomic_uchar*>(__obj), __desr, |
| 4379 | __o); |
| 4380 | } |
| 4381 | |
| 4382 | inline _LIBCPP_INLINE_VISIBILITY |
| 4383 | unsigned char |
| 4384 | atomic_load(const volatile atomic_uchar* __obj) |
| 4385 | { |
| 4386 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 4387 | } |
| 4388 | |
| 4389 | inline _LIBCPP_INLINE_VISIBILITY |
| 4390 | unsigned char |
| 4391 | atomic_load(const atomic_uchar* __obj) |
| 4392 | { |
| 4393 | return atomic_load(const_cast<const volatile atomic_uchar*>(__obj)); |
| 4394 | } |
| 4395 | |
| 4396 | inline _LIBCPP_INLINE_VISIBILITY |
| 4397 | unsigned char |
| 4398 | atomic_load_explicit(const volatile atomic_uchar* __obj, memory_order __o) |
| 4399 | { |
| 4400 | return __atomic_load(&__obj->__v_, __o); |
| 4401 | } |
| 4402 | |
| 4403 | inline _LIBCPP_INLINE_VISIBILITY |
| 4404 | unsigned char |
| 4405 | atomic_load_explicit(const atomic_uchar* __obj, memory_order __o) |
| 4406 | { |
| 4407 | return atomic_load_explicit(const_cast<const volatile atomic_uchar*> |
| 4408 | (__obj), __o); |
| 4409 | } |
| 4410 | |
| 4411 | inline _LIBCPP_INLINE_VISIBILITY |
| 4412 | unsigned char |
| 4413 | atomic_exchange(volatile atomic_uchar* __obj, unsigned char __desr) |
| 4414 | { |
| 4415 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 4416 | } |
| 4417 | |
| 4418 | inline _LIBCPP_INLINE_VISIBILITY |
| 4419 | unsigned char |
| 4420 | atomic_exchange(atomic_uchar* __obj, unsigned char __desr) |
| 4421 | { |
| 4422 | return atomic_exchange(const_cast<volatile atomic_uchar*>(__obj), __desr); |
| 4423 | } |
| 4424 | |
| 4425 | inline _LIBCPP_INLINE_VISIBILITY |
| 4426 | unsigned char |
| 4427 | atomic_exchange_explicit(volatile atomic_uchar* __obj, unsigned char __desr, |
| 4428 | memory_order __o) |
| 4429 | { |
| 4430 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 4431 | } |
| 4432 | |
| 4433 | inline _LIBCPP_INLINE_VISIBILITY |
| 4434 | unsigned char |
| 4435 | atomic_exchange_explicit(atomic_uchar* __obj, unsigned char __desr, |
| 4436 | memory_order __o) |
| 4437 | { |
| 4438 | return atomic_exchange_explicit(const_cast<volatile atomic_uchar*> |
| 4439 | (__obj), __desr, __o); |
| 4440 | } |
| 4441 | |
| 4442 | inline _LIBCPP_INLINE_VISIBILITY |
| 4443 | bool |
| 4444 | atomic_compare_exchange_weak(volatile atomic_uchar* __obj, unsigned char* __exp, |
| 4445 | unsigned char __desr) |
| 4446 | { |
| 4447 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 4448 | memory_order_seq_cst, memory_order_seq_cst); |
| 4449 | } |
| 4450 | |
| 4451 | inline _LIBCPP_INLINE_VISIBILITY |
| 4452 | bool |
| 4453 | atomic_compare_exchange_weak(atomic_uchar* __obj, unsigned char* __exp, |
| 4454 | unsigned char __desr) |
| 4455 | { |
| 4456 | return atomic_compare_exchange_weak(const_cast<volatile atomic_uchar*> |
| 4457 | (__obj), __exp, __desr); |
| 4458 | } |
| 4459 | |
| 4460 | inline _LIBCPP_INLINE_VISIBILITY |
| 4461 | bool |
| 4462 | atomic_compare_exchange_strong(volatile atomic_uchar* __obj, |
| 4463 | unsigned char* __exp, unsigned char __desr) |
| 4464 | { |
| 4465 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 4466 | memory_order_seq_cst, memory_order_seq_cst); |
| 4467 | } |
| 4468 | |
| 4469 | inline _LIBCPP_INLINE_VISIBILITY |
| 4470 | bool |
| 4471 | atomic_compare_exchange_strong(atomic_uchar* __obj, unsigned char* __exp, |
| 4472 | unsigned char __desr) |
| 4473 | { |
| 4474 | return atomic_compare_exchange_strong(const_cast<volatile atomic_uchar*> |
| 4475 | (__obj), __exp, __desr); |
| 4476 | } |
| 4477 | |
| 4478 | inline _LIBCPP_INLINE_VISIBILITY |
| 4479 | bool |
| 4480 | atomic_compare_exchange_weak_explicit(volatile atomic_uchar* __obj, |
| 4481 | unsigned char* __exp, |
| 4482 | unsigned char __desr, memory_order __s, |
| 4483 | memory_order __f) |
| 4484 | { |
| 4485 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 4486 | __f); |
| 4487 | } |
| 4488 | |
| 4489 | inline _LIBCPP_INLINE_VISIBILITY |
| 4490 | bool |
| 4491 | atomic_compare_exchange_weak_explicit(atomic_uchar* __obj, unsigned char* __exp, |
| 4492 | unsigned char __desr, memory_order __s, |
| 4493 | memory_order __f) |
| 4494 | { |
| 4495 | return atomic_compare_exchange_weak_explicit( |
| 4496 | const_cast<volatile atomic_uchar*>(__obj), __exp, __desr, __s, __f); |
| 4497 | } |
| 4498 | |
| 4499 | inline _LIBCPP_INLINE_VISIBILITY |
| 4500 | bool |
| 4501 | atomic_compare_exchange_strong_explicit(volatile atomic_uchar* __obj, |
| 4502 | unsigned char* __exp, |
| 4503 | unsigned char __desr, memory_order __s, |
| 4504 | memory_order __f) |
| 4505 | { |
| 4506 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 4507 | __f); |
| 4508 | } |
| 4509 | |
| 4510 | inline _LIBCPP_INLINE_VISIBILITY |
| 4511 | bool |
| 4512 | atomic_compare_exchange_strong_explicit(atomic_uchar* __obj, |
| 4513 | unsigned char* __exp, |
| 4514 | unsigned char __desr, memory_order __s, |
| 4515 | memory_order __f) |
| 4516 | { |
| 4517 | return atomic_compare_exchange_strong_explicit( |
| 4518 | const_cast<volatile atomic_uchar*>(__obj), __exp, __desr, __s, __f); |
| 4519 | } |
| 4520 | |
| 4521 | inline _LIBCPP_INLINE_VISIBILITY |
| 4522 | unsigned char |
| 4523 | atomic_fetch_add(volatile atomic_uchar* __obj, unsigned char __v) |
| 4524 | { |
| 4525 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 4526 | } |
| 4527 | |
| 4528 | inline _LIBCPP_INLINE_VISIBILITY |
| 4529 | unsigned char |
| 4530 | atomic_fetch_add(atomic_uchar* __obj, unsigned char __v) |
| 4531 | { |
| 4532 | return atomic_fetch_add(const_cast<volatile atomic_uchar*>(__obj), __v); |
| 4533 | } |
| 4534 | |
| 4535 | inline _LIBCPP_INLINE_VISIBILITY |
| 4536 | unsigned char |
| 4537 | atomic_fetch_add_explicit(volatile atomic_uchar* __obj, unsigned char __v, |
| 4538 | memory_order __o) |
| 4539 | { |
| 4540 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 4541 | } |
| 4542 | |
| 4543 | inline _LIBCPP_INLINE_VISIBILITY |
| 4544 | unsigned char |
| 4545 | atomic_fetch_add_explicit(atomic_uchar* __obj, unsigned char __v, |
| 4546 | memory_order __o) |
| 4547 | { |
| 4548 | return atomic_fetch_add_explicit(const_cast<volatile atomic_uchar*>(__obj), |
| 4549 | __v, __o); |
| 4550 | } |
| 4551 | |
| 4552 | inline _LIBCPP_INLINE_VISIBILITY |
| 4553 | unsigned char |
| 4554 | atomic_fetch_sub(volatile atomic_uchar* __obj, unsigned char __v) |
| 4555 | { |
| 4556 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 4557 | } |
| 4558 | |
| 4559 | inline _LIBCPP_INLINE_VISIBILITY |
| 4560 | unsigned char |
| 4561 | atomic_fetch_sub(atomic_uchar* __obj, unsigned char __v) |
| 4562 | { |
| 4563 | return atomic_fetch_sub(const_cast<volatile atomic_uchar*>(__obj), __v); |
| 4564 | } |
| 4565 | |
| 4566 | inline _LIBCPP_INLINE_VISIBILITY |
| 4567 | unsigned char |
| 4568 | atomic_fetch_sub_explicit(volatile atomic_uchar* __obj, unsigned char __v, |
| 4569 | memory_order __o) |
| 4570 | { |
| 4571 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 4572 | } |
| 4573 | |
| 4574 | inline _LIBCPP_INLINE_VISIBILITY |
| 4575 | unsigned char |
| 4576 | atomic_fetch_sub_explicit(atomic_uchar* __obj, unsigned char __v, |
| 4577 | memory_order __o) |
| 4578 | { |
| 4579 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_uchar*>(__obj), |
| 4580 | __v, __o); |
| 4581 | } |
| 4582 | |
| 4583 | inline _LIBCPP_INLINE_VISIBILITY |
| 4584 | unsigned char |
| 4585 | atomic_fetch_and(volatile atomic_uchar* __obj, unsigned char __v) |
| 4586 | { |
| 4587 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 4588 | } |
| 4589 | |
| 4590 | inline _LIBCPP_INLINE_VISIBILITY |
| 4591 | unsigned char |
| 4592 | atomic_fetch_and(atomic_uchar* __obj, unsigned char __v) |
| 4593 | { |
| 4594 | return atomic_fetch_and(const_cast<volatile atomic_uchar*>(__obj), __v); |
| 4595 | } |
| 4596 | |
| 4597 | inline _LIBCPP_INLINE_VISIBILITY |
| 4598 | unsigned char |
| 4599 | atomic_fetch_and_explicit(volatile atomic_uchar* __obj, unsigned char __v, |
| 4600 | memory_order __o) |
| 4601 | { |
| 4602 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 4603 | } |
| 4604 | |
| 4605 | inline _LIBCPP_INLINE_VISIBILITY |
| 4606 | unsigned char |
| 4607 | atomic_fetch_and_explicit(atomic_uchar* __obj, unsigned char __v, |
| 4608 | memory_order __o) |
| 4609 | { |
| 4610 | return atomic_fetch_and_explicit(const_cast<volatile atomic_uchar*>(__obj), |
| 4611 | __v, __o); |
| 4612 | } |
| 4613 | |
| 4614 | inline _LIBCPP_INLINE_VISIBILITY |
| 4615 | unsigned char |
| 4616 | atomic_fetch_or(volatile atomic_uchar* __obj, unsigned char __v) |
| 4617 | { |
| 4618 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 4619 | } |
| 4620 | |
| 4621 | inline _LIBCPP_INLINE_VISIBILITY |
| 4622 | unsigned char |
| 4623 | atomic_fetch_or(atomic_uchar* __obj, unsigned char __v) |
| 4624 | { |
| 4625 | return atomic_fetch_or(const_cast<volatile atomic_uchar*>(__obj), __v); |
| 4626 | } |
| 4627 | |
| 4628 | inline _LIBCPP_INLINE_VISIBILITY |
| 4629 | unsigned char |
| 4630 | atomic_fetch_or_explicit(volatile atomic_uchar* __obj, unsigned char __v, |
| 4631 | memory_order __o) |
| 4632 | { |
| 4633 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 4634 | } |
| 4635 | |
| 4636 | inline _LIBCPP_INLINE_VISIBILITY |
| 4637 | unsigned char |
| 4638 | atomic_fetch_or_explicit(atomic_uchar* __obj, unsigned char __v, |
| 4639 | memory_order __o) |
| 4640 | { |
| 4641 | return atomic_fetch_or_explicit(const_cast<volatile atomic_uchar*>(__obj), |
| 4642 | __v, __o); |
| 4643 | } |
| 4644 | |
| 4645 | inline _LIBCPP_INLINE_VISIBILITY |
| 4646 | unsigned char |
| 4647 | atomic_fetch_xor(volatile atomic_uchar* __obj, unsigned char __v) |
| 4648 | { |
| 4649 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 4650 | } |
| 4651 | |
| 4652 | inline _LIBCPP_INLINE_VISIBILITY |
| 4653 | unsigned char |
| 4654 | atomic_fetch_xor(atomic_uchar* __obj, unsigned char __v) |
| 4655 | { |
| 4656 | return atomic_fetch_xor(const_cast<volatile atomic_uchar*>(__obj), __v); |
| 4657 | } |
| 4658 | |
| 4659 | inline _LIBCPP_INLINE_VISIBILITY |
| 4660 | unsigned char |
| 4661 | atomic_fetch_xor_explicit(volatile atomic_uchar* __obj, unsigned char __v, |
| 4662 | memory_order __o) |
| 4663 | { |
| 4664 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 4665 | } |
| 4666 | |
| 4667 | inline _LIBCPP_INLINE_VISIBILITY |
| 4668 | unsigned char |
| 4669 | atomic_fetch_xor_explicit(atomic_uchar* __obj, unsigned char __v, |
| 4670 | memory_order __o) |
| 4671 | { |
| 4672 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_uchar*>(__obj), |
| 4673 | __v, __o); |
| 4674 | } |
| 4675 | |
| 4676 | // atomic_short |
| 4677 | |
| 4678 | struct atomic_short; |
| 4679 | |
| 4680 | bool atomic_is_lock_free(const volatile atomic_short*); |
| 4681 | bool atomic_is_lock_free(const atomic_short*); |
| 4682 | void atomic_init(volatile atomic_short*, short); |
| 4683 | void atomic_init(atomic_short*, short); |
| 4684 | void atomic_store(volatile atomic_short*, short); |
| 4685 | void atomic_store(atomic_short*, short); |
| 4686 | void atomic_store_explicit(volatile atomic_short*, short, memory_order); |
| 4687 | void atomic_store_explicit(atomic_short*, short, memory_order); |
| 4688 | short atomic_load(const volatile atomic_short*); |
| 4689 | short atomic_load(const atomic_short*); |
| 4690 | short atomic_load_explicit(const volatile atomic_short*, memory_order); |
| 4691 | short atomic_load_explicit(const atomic_short*, memory_order); |
| 4692 | short atomic_exchange(volatile atomic_short*, short); |
| 4693 | short atomic_exchange(atomic_short*, short); |
| 4694 | short atomic_exchange_explicit(volatile atomic_short*, short, memory_order); |
| 4695 | short atomic_exchange_explicit(atomic_short*, short, memory_order); |
| 4696 | bool atomic_compare_exchange_weak(volatile atomic_short*, short*, short); |
| 4697 | bool atomic_compare_exchange_weak(atomic_short*, short*, short); |
| 4698 | bool atomic_compare_exchange_strong(volatile atomic_short*, short*, short); |
| 4699 | bool atomic_compare_exchange_strong(atomic_short*, short*, short); |
| 4700 | bool atomic_compare_exchange_weak_explicit(volatile atomic_short*, short*, |
| 4701 | short, memory_order, memory_order); |
| 4702 | bool atomic_compare_exchange_weak_explicit(atomic_short*, short*, short, |
| 4703 | memory_order, memory_order); |
| 4704 | bool atomic_compare_exchange_strong_explicit(volatile atomic_short*, short*, |
| 4705 | short, memory_order, memory_order); |
| 4706 | bool atomic_compare_exchange_strong_explicit(atomic_short*, short*, short, |
| 4707 | memory_order, memory_order); |
| 4708 | short atomic_fetch_add(volatile atomic_short*, short); |
| 4709 | short atomic_fetch_add(atomic_short*, short); |
| 4710 | short atomic_fetch_add_explicit(volatile atomic_short*, short, memory_order); |
| 4711 | short atomic_fetch_add_explicit(atomic_short*, short, memory_order); |
| 4712 | short atomic_fetch_sub(volatile atomic_short*, short); |
| 4713 | short atomic_fetch_sub(atomic_short*, short); |
| 4714 | short atomic_fetch_sub_explicit(volatile atomic_short*, short, memory_order); |
| 4715 | short atomic_fetch_sub_explicit(atomic_short*, short, memory_order); |
| 4716 | short atomic_fetch_and(volatile atomic_short*, short); |
| 4717 | short atomic_fetch_and(atomic_short*, short); |
| 4718 | short atomic_fetch_and_explicit(volatile atomic_short*, short, memory_order); |
| 4719 | short atomic_fetch_and_explicit(atomic_short*, short, memory_order); |
| 4720 | short atomic_fetch_or(volatile atomic_short*, short); |
| 4721 | short atomic_fetch_or(atomic_short*, short); |
| 4722 | short atomic_fetch_or_explicit(volatile atomic_short*, short, memory_order); |
| 4723 | short atomic_fetch_or_explicit(atomic_short*, short, memory_order); |
| 4724 | short atomic_fetch_xor(volatile atomic_short*, short); |
| 4725 | short atomic_fetch_xor(atomic_short*, short); |
| 4726 | short atomic_fetch_xor_explicit(volatile atomic_short*, short, memory_order); |
| 4727 | short atomic_fetch_xor_explicit(atomic_short*, short, memory_order); |
| 4728 | |
| 4729 | typedef struct atomic_short |
| 4730 | { |
| 4731 | short __v_; |
| 4732 | |
| 4733 | _LIBCPP_INLINE_VISIBILITY |
| 4734 | bool is_lock_free() const volatile |
| 4735 | {return atomic_is_lock_free(this);} |
| 4736 | _LIBCPP_INLINE_VISIBILITY |
| 4737 | bool is_lock_free() const |
| 4738 | {return atomic_is_lock_free(this);} |
| 4739 | _LIBCPP_INLINE_VISIBILITY |
| 4740 | void store(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4741 | {atomic_store_explicit(this, __v, __o);} |
| 4742 | _LIBCPP_INLINE_VISIBILITY |
| 4743 | void store(short __v, memory_order __o = memory_order_seq_cst) |
| 4744 | {atomic_store_explicit(this, __v, __o);} |
| 4745 | _LIBCPP_INLINE_VISIBILITY |
| 4746 | short load(memory_order __o = memory_order_seq_cst) const volatile |
| 4747 | {return atomic_load_explicit(this, __o);} |
| 4748 | _LIBCPP_INLINE_VISIBILITY |
| 4749 | short load(memory_order __o = memory_order_seq_cst) const |
| 4750 | {return atomic_load_explicit(this, __o);} |
| 4751 | _LIBCPP_INLINE_VISIBILITY |
| 4752 | operator short() const volatile |
| 4753 | {return load();} |
| 4754 | _LIBCPP_INLINE_VISIBILITY |
| 4755 | operator short() const |
| 4756 | {return load();} |
| 4757 | _LIBCPP_INLINE_VISIBILITY |
| 4758 | short exchange(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4759 | {return atomic_exchange_explicit(this, __v, __o);} |
| 4760 | _LIBCPP_INLINE_VISIBILITY |
| 4761 | short exchange(short __v, memory_order __o = memory_order_seq_cst) |
| 4762 | {return atomic_exchange_explicit(this, __v, __o);} |
| 4763 | _LIBCPP_INLINE_VISIBILITY |
| 4764 | bool compare_exchange_weak(short& __v, short __e, memory_order __s, |
| 4765 | memory_order __f) volatile |
| 4766 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4767 | __f);} |
| 4768 | _LIBCPP_INLINE_VISIBILITY |
| 4769 | bool compare_exchange_weak(short& __v, short __e, memory_order __s, |
| 4770 | memory_order __f) |
| 4771 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4772 | __f);} |
| 4773 | _LIBCPP_INLINE_VISIBILITY |
| 4774 | bool compare_exchange_strong(short& __v, short __e, memory_order __s, |
| 4775 | memory_order __f) volatile |
| 4776 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4777 | __f);} |
| 4778 | _LIBCPP_INLINE_VISIBILITY |
| 4779 | bool compare_exchange_strong(short& __v, short __e, memory_order __s, |
| 4780 | memory_order __f) |
| 4781 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4782 | __f);} |
| 4783 | _LIBCPP_INLINE_VISIBILITY |
| 4784 | bool compare_exchange_weak(short& __v, short __e, |
| 4785 | memory_order __s = memory_order_seq_cst) volatile |
| 4786 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4787 | __translate_memory_order(__s));} |
| 4788 | _LIBCPP_INLINE_VISIBILITY |
| 4789 | bool compare_exchange_weak(short& __v, short __e, |
| 4790 | memory_order __s = memory_order_seq_cst) |
| 4791 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 4792 | __translate_memory_order(__s));} |
| 4793 | _LIBCPP_INLINE_VISIBILITY |
| 4794 | bool compare_exchange_strong(short& __v, short __e, |
| 4795 | memory_order __s = memory_order_seq_cst) volatile |
| 4796 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4797 | __translate_memory_order(__s));} |
| 4798 | _LIBCPP_INLINE_VISIBILITY |
| 4799 | bool compare_exchange_strong(short& __v, short __e, |
| 4800 | memory_order __s = memory_order_seq_cst) |
| 4801 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 4802 | __translate_memory_order(__s));} |
| 4803 | _LIBCPP_INLINE_VISIBILITY |
| 4804 | short fetch_add(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4805 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 4806 | _LIBCPP_INLINE_VISIBILITY |
| 4807 | short fetch_add(short __v, memory_order __o = memory_order_seq_cst) |
| 4808 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 4809 | _LIBCPP_INLINE_VISIBILITY |
| 4810 | short fetch_sub(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4811 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 4812 | _LIBCPP_INLINE_VISIBILITY |
| 4813 | short fetch_sub(short __v, memory_order __o = memory_order_seq_cst) |
| 4814 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 4815 | _LIBCPP_INLINE_VISIBILITY |
| 4816 | short fetch_and(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4817 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 4818 | _LIBCPP_INLINE_VISIBILITY |
| 4819 | short fetch_and(short __v, memory_order __o = memory_order_seq_cst) |
| 4820 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 4821 | _LIBCPP_INLINE_VISIBILITY |
| 4822 | short fetch_or(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4823 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 4824 | _LIBCPP_INLINE_VISIBILITY |
| 4825 | short fetch_or(short __v, memory_order __o = memory_order_seq_cst) |
| 4826 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 4827 | _LIBCPP_INLINE_VISIBILITY |
| 4828 | short fetch_xor(short __v, memory_order __o = memory_order_seq_cst) volatile |
| 4829 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 4830 | _LIBCPP_INLINE_VISIBILITY |
| 4831 | short fetch_xor(short __v, memory_order __o = memory_order_seq_cst) |
| 4832 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 4833 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 4834 | atomic_short() = default; |
| 4835 | #else |
| 4836 | _LIBCPP_INLINE_VISIBILITY |
| 4837 | atomic_short() {} |
| 4838 | #endif |
| 4839 | _LIBCPP_INLINE_VISIBILITY |
| 4840 | /*constexpr*/ atomic_short(short __v) |
| 4841 | : __v_(__v) {} |
| 4842 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 4843 | atomic_short(const atomic_short&) = delete; |
| 4844 | atomic_short& operator=(const atomic_short&) = delete; |
| 4845 | atomic_short& operator=(const atomic_short&) volatile = delete; |
| 4846 | #else |
| 4847 | private: |
| 4848 | atomic_short(const atomic_short&); |
| 4849 | atomic_short& operator=(const atomic_short&); |
| 4850 | atomic_short& operator=(const atomic_short&) volatile; |
| 4851 | public: |
| 4852 | #endif |
| 4853 | _LIBCPP_INLINE_VISIBILITY |
| 4854 | short operator=(short __v) volatile |
| 4855 | {store(__v); return __v;} |
| 4856 | _LIBCPP_INLINE_VISIBILITY |
| 4857 | short operator=(short __v) |
| 4858 | {store(__v); return __v;} |
| 4859 | _LIBCPP_INLINE_VISIBILITY |
| 4860 | short operator++(int) volatile |
| 4861 | {return fetch_add(short(1));} |
| 4862 | _LIBCPP_INLINE_VISIBILITY |
| 4863 | short operator++(int) |
| 4864 | {return fetch_add(short(1));} |
| 4865 | _LIBCPP_INLINE_VISIBILITY |
| 4866 | short operator--(int) volatile |
| 4867 | {return fetch_sub(short(1));} |
| 4868 | _LIBCPP_INLINE_VISIBILITY |
| 4869 | short operator--(int) |
| 4870 | {return fetch_sub(short(1));} |
| 4871 | _LIBCPP_INLINE_VISIBILITY |
| 4872 | short operator++() volatile |
| 4873 | {return short(fetch_add(short(1)) + 1);} |
| 4874 | _LIBCPP_INLINE_VISIBILITY |
| 4875 | short operator++() |
| 4876 | {return short(fetch_add(short(1)) + 1);} |
| 4877 | _LIBCPP_INLINE_VISIBILITY |
| 4878 | short operator--() volatile |
| 4879 | {return short(fetch_sub(short(1)) - 1);} |
| 4880 | _LIBCPP_INLINE_VISIBILITY |
| 4881 | short operator--() |
| 4882 | {return short(fetch_sub(short(1)) - 1);} |
| 4883 | _LIBCPP_INLINE_VISIBILITY |
| 4884 | short operator+=(short __v) volatile |
| 4885 | {return short(fetch_add(__v) + __v);} |
| 4886 | _LIBCPP_INLINE_VISIBILITY |
| 4887 | short operator+=(short __v) |
| 4888 | {return short(fetch_add(__v) + __v);} |
| 4889 | _LIBCPP_INLINE_VISIBILITY |
| 4890 | short operator-=(short __v) volatile |
| 4891 | {return short(fetch_sub(__v) - __v);} |
| 4892 | _LIBCPP_INLINE_VISIBILITY |
| 4893 | short operator-=(short __v) |
| 4894 | {return short(fetch_sub(__v) - __v);} |
| 4895 | _LIBCPP_INLINE_VISIBILITY |
| 4896 | short operator&=(short __v) volatile |
| 4897 | {return short(fetch_and(__v) & __v);} |
| 4898 | _LIBCPP_INLINE_VISIBILITY |
| 4899 | short operator&=(short __v) |
| 4900 | {return short(fetch_and(__v) & __v);} |
| 4901 | _LIBCPP_INLINE_VISIBILITY |
| 4902 | short operator|=(short __v) volatile |
| 4903 | {return short(fetch_or(__v) | __v);} |
| 4904 | _LIBCPP_INLINE_VISIBILITY |
| 4905 | short operator|=(short __v) |
| 4906 | {return short(fetch_or(__v) | __v);} |
| 4907 | _LIBCPP_INLINE_VISIBILITY |
| 4908 | short operator^=(short __v) volatile |
| 4909 | {return short(fetch_xor(__v) ^ __v);} |
| 4910 | _LIBCPP_INLINE_VISIBILITY |
| 4911 | short operator^=(short __v) |
| 4912 | {return short(fetch_xor(__v) ^ __v);} |
| 4913 | } atomic_short; |
| 4914 | |
| 4915 | inline _LIBCPP_INLINE_VISIBILITY |
| 4916 | bool |
| 4917 | atomic_is_lock_free(const volatile atomic_short*) |
| 4918 | { |
| 4919 | typedef short type; |
| 4920 | return __atomic_is_lock_free(type); |
| 4921 | } |
| 4922 | |
| 4923 | inline _LIBCPP_INLINE_VISIBILITY |
| 4924 | bool |
| 4925 | atomic_is_lock_free(const atomic_short* __obj) |
| 4926 | { |
| 4927 | return atomic_is_lock_free(const_cast<volatile atomic_short*>(__obj)); |
| 4928 | } |
| 4929 | |
| 4930 | inline _LIBCPP_INLINE_VISIBILITY |
| 4931 | void |
| 4932 | atomic_init(volatile atomic_short* __obj, short __desr) |
| 4933 | { |
| 4934 | __obj->__v_ = __desr; |
| 4935 | } |
| 4936 | |
| 4937 | inline _LIBCPP_INLINE_VISIBILITY |
| 4938 | void |
| 4939 | atomic_init(atomic_short* __obj, short __desr) |
| 4940 | { |
| 4941 | __obj->__v_ = __desr; |
| 4942 | } |
| 4943 | |
| 4944 | inline _LIBCPP_INLINE_VISIBILITY |
| 4945 | void |
| 4946 | atomic_store(volatile atomic_short* __obj, short __desr) |
| 4947 | { |
| 4948 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 4949 | } |
| 4950 | |
| 4951 | inline _LIBCPP_INLINE_VISIBILITY |
| 4952 | void |
| 4953 | atomic_store(atomic_short* __obj, short __desr) |
| 4954 | { |
| 4955 | atomic_store(const_cast<volatile atomic_short*>(__obj), __desr); |
| 4956 | } |
| 4957 | |
| 4958 | inline _LIBCPP_INLINE_VISIBILITY |
| 4959 | void |
| 4960 | atomic_store_explicit(volatile atomic_short* __obj, short __desr, |
| 4961 | memory_order __o) |
| 4962 | { |
| 4963 | __atomic_store(&__obj->__v_, __desr, __o); |
| 4964 | } |
| 4965 | |
| 4966 | inline _LIBCPP_INLINE_VISIBILITY |
| 4967 | void |
| 4968 | atomic_store_explicit(atomic_short* __obj, short __desr, memory_order __o) |
| 4969 | { |
| 4970 | atomic_store_explicit(const_cast<volatile atomic_short*>(__obj), __desr, |
| 4971 | __o); |
| 4972 | } |
| 4973 | |
| 4974 | inline _LIBCPP_INLINE_VISIBILITY |
| 4975 | short |
| 4976 | atomic_load(const volatile atomic_short* __obj) |
| 4977 | { |
| 4978 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 4979 | } |
| 4980 | |
| 4981 | inline _LIBCPP_INLINE_VISIBILITY |
| 4982 | short |
| 4983 | atomic_load(const atomic_short* __obj) |
| 4984 | { |
| 4985 | return atomic_load(const_cast<const volatile atomic_short*>(__obj)); |
| 4986 | } |
| 4987 | |
| 4988 | inline _LIBCPP_INLINE_VISIBILITY |
| 4989 | short |
| 4990 | atomic_load_explicit(const volatile atomic_short* __obj, memory_order __o) |
| 4991 | { |
| 4992 | return __atomic_load(&__obj->__v_, __o); |
| 4993 | } |
| 4994 | |
| 4995 | inline _LIBCPP_INLINE_VISIBILITY |
| 4996 | short |
| 4997 | atomic_load_explicit(const atomic_short* __obj, memory_order __o) |
| 4998 | { |
| 4999 | return atomic_load_explicit(const_cast<const volatile atomic_short*> |
| 5000 | (__obj), __o); |
| 5001 | } |
| 5002 | |
| 5003 | inline _LIBCPP_INLINE_VISIBILITY |
| 5004 | short |
| 5005 | atomic_exchange(volatile atomic_short* __obj, short __desr) |
| 5006 | { |
| 5007 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 5008 | } |
| 5009 | |
| 5010 | inline _LIBCPP_INLINE_VISIBILITY |
| 5011 | short |
| 5012 | atomic_exchange(atomic_short* __obj, short __desr) |
| 5013 | { |
| 5014 | return atomic_exchange(const_cast<volatile atomic_short*>(__obj), __desr); |
| 5015 | } |
| 5016 | |
| 5017 | inline _LIBCPP_INLINE_VISIBILITY |
| 5018 | short |
| 5019 | atomic_exchange_explicit(volatile atomic_short* __obj, short __desr, |
| 5020 | memory_order __o) |
| 5021 | { |
| 5022 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 5023 | } |
| 5024 | |
| 5025 | inline _LIBCPP_INLINE_VISIBILITY |
| 5026 | short |
| 5027 | atomic_exchange_explicit(atomic_short* __obj, short __desr, memory_order __o) |
| 5028 | { |
| 5029 | return atomic_exchange_explicit(const_cast<volatile atomic_short*> |
| 5030 | (__obj), __desr, __o); |
| 5031 | } |
| 5032 | |
| 5033 | inline _LIBCPP_INLINE_VISIBILITY |
| 5034 | bool |
| 5035 | atomic_compare_exchange_weak(volatile atomic_short* __obj, short* __exp, |
| 5036 | short __desr) |
| 5037 | { |
| 5038 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 5039 | memory_order_seq_cst, memory_order_seq_cst); |
| 5040 | } |
| 5041 | |
| 5042 | inline _LIBCPP_INLINE_VISIBILITY |
| 5043 | bool |
| 5044 | atomic_compare_exchange_weak(atomic_short* __obj, short* __exp, short __desr) |
| 5045 | { |
| 5046 | return atomic_compare_exchange_weak(const_cast<volatile atomic_short*> |
| 5047 | (__obj), __exp, __desr); |
| 5048 | } |
| 5049 | |
| 5050 | inline _LIBCPP_INLINE_VISIBILITY |
| 5051 | bool |
| 5052 | atomic_compare_exchange_strong(volatile atomic_short* __obj, short* __exp, |
| 5053 | short __desr) |
| 5054 | { |
| 5055 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 5056 | memory_order_seq_cst, memory_order_seq_cst); |
| 5057 | } |
| 5058 | |
| 5059 | inline _LIBCPP_INLINE_VISIBILITY |
| 5060 | bool |
| 5061 | atomic_compare_exchange_strong(atomic_short* __obj, short* __exp, short __desr) |
| 5062 | { |
| 5063 | return atomic_compare_exchange_strong(const_cast<volatile atomic_short*> |
| 5064 | (__obj), __exp, __desr); |
| 5065 | } |
| 5066 | |
| 5067 | inline _LIBCPP_INLINE_VISIBILITY |
| 5068 | bool |
| 5069 | atomic_compare_exchange_weak_explicit(volatile atomic_short* __obj, |
| 5070 | short* __exp, short __desr, |
| 5071 | memory_order __s, memory_order __f) |
| 5072 | { |
| 5073 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 5074 | __f); |
| 5075 | } |
| 5076 | |
| 5077 | inline _LIBCPP_INLINE_VISIBILITY |
| 5078 | bool |
| 5079 | atomic_compare_exchange_weak_explicit(atomic_short* __obj, short* __exp, |
| 5080 | short __desr, memory_order __s, |
| 5081 | memory_order __f) |
| 5082 | { |
| 5083 | return atomic_compare_exchange_weak_explicit( |
| 5084 | const_cast<volatile atomic_short*>(__obj), __exp, __desr, __s, __f); |
| 5085 | } |
| 5086 | |
| 5087 | inline _LIBCPP_INLINE_VISIBILITY |
| 5088 | bool |
| 5089 | atomic_compare_exchange_strong_explicit(volatile atomic_short* __obj, |
| 5090 | short* __exp, short __desr, |
| 5091 | memory_order __s, memory_order __f) |
| 5092 | { |
| 5093 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 5094 | __f); |
| 5095 | } |
| 5096 | |
| 5097 | inline _LIBCPP_INLINE_VISIBILITY |
| 5098 | bool |
| 5099 | atomic_compare_exchange_strong_explicit(atomic_short* __obj, short* __exp, |
| 5100 | short __desr, memory_order __s, |
| 5101 | memory_order __f) |
| 5102 | { |
| 5103 | return atomic_compare_exchange_strong_explicit( |
| 5104 | const_cast<volatile atomic_short*>(__obj), __exp, __desr, __s, __f); |
| 5105 | } |
| 5106 | |
| 5107 | inline _LIBCPP_INLINE_VISIBILITY |
| 5108 | short |
| 5109 | atomic_fetch_add(volatile atomic_short* __obj, short __v) |
| 5110 | { |
| 5111 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 5112 | } |
| 5113 | |
| 5114 | inline _LIBCPP_INLINE_VISIBILITY |
| 5115 | short |
| 5116 | atomic_fetch_add(atomic_short* __obj, short __v) |
| 5117 | { |
| 5118 | return atomic_fetch_add(const_cast<volatile atomic_short*>(__obj), __v); |
| 5119 | } |
| 5120 | |
| 5121 | inline _LIBCPP_INLINE_VISIBILITY |
| 5122 | short |
| 5123 | atomic_fetch_add_explicit(volatile atomic_short* __obj, short __v, |
| 5124 | memory_order __o) |
| 5125 | { |
| 5126 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 5127 | } |
| 5128 | |
| 5129 | inline _LIBCPP_INLINE_VISIBILITY |
| 5130 | short |
| 5131 | atomic_fetch_add_explicit(atomic_short* __obj, short __v, memory_order __o) |
| 5132 | { |
| 5133 | return atomic_fetch_add_explicit(const_cast<volatile atomic_short*>(__obj), |
| 5134 | __v, __o); |
| 5135 | } |
| 5136 | |
| 5137 | inline _LIBCPP_INLINE_VISIBILITY |
| 5138 | short |
| 5139 | atomic_fetch_sub(volatile atomic_short* __obj, short __v) |
| 5140 | { |
| 5141 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 5142 | } |
| 5143 | |
| 5144 | inline _LIBCPP_INLINE_VISIBILITY |
| 5145 | short |
| 5146 | atomic_fetch_sub(atomic_short* __obj, short __v) |
| 5147 | { |
| 5148 | return atomic_fetch_sub(const_cast<volatile atomic_short*>(__obj), __v); |
| 5149 | } |
| 5150 | |
| 5151 | inline _LIBCPP_INLINE_VISIBILITY |
| 5152 | short |
| 5153 | atomic_fetch_sub_explicit(volatile atomic_short* __obj, short __v, |
| 5154 | memory_order __o) |
| 5155 | { |
| 5156 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 5157 | } |
| 5158 | |
| 5159 | inline _LIBCPP_INLINE_VISIBILITY |
| 5160 | short |
| 5161 | atomic_fetch_sub_explicit(atomic_short* __obj, short __v, memory_order __o) |
| 5162 | { |
| 5163 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_short*>(__obj), |
| 5164 | __v, __o); |
| 5165 | } |
| 5166 | |
| 5167 | inline _LIBCPP_INLINE_VISIBILITY |
| 5168 | short |
| 5169 | atomic_fetch_and(volatile atomic_short* __obj, short __v) |
| 5170 | { |
| 5171 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 5172 | } |
| 5173 | |
| 5174 | inline _LIBCPP_INLINE_VISIBILITY |
| 5175 | short |
| 5176 | atomic_fetch_and(atomic_short* __obj, short __v) |
| 5177 | { |
| 5178 | return atomic_fetch_and(const_cast<volatile atomic_short*>(__obj), __v); |
| 5179 | } |
| 5180 | |
| 5181 | inline _LIBCPP_INLINE_VISIBILITY |
| 5182 | short |
| 5183 | atomic_fetch_and_explicit(volatile atomic_short* __obj, short __v, |
| 5184 | memory_order __o) |
| 5185 | { |
| 5186 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 5187 | } |
| 5188 | |
| 5189 | inline _LIBCPP_INLINE_VISIBILITY |
| 5190 | short |
| 5191 | atomic_fetch_and_explicit(atomic_short* __obj, short __v, memory_order __o) |
| 5192 | { |
| 5193 | return atomic_fetch_and_explicit(const_cast<volatile atomic_short*>(__obj), |
| 5194 | __v, __o); |
| 5195 | } |
| 5196 | |
| 5197 | inline _LIBCPP_INLINE_VISIBILITY |
| 5198 | short |
| 5199 | atomic_fetch_or(volatile atomic_short* __obj, short __v) |
| 5200 | { |
| 5201 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 5202 | } |
| 5203 | |
| 5204 | inline _LIBCPP_INLINE_VISIBILITY |
| 5205 | short |
| 5206 | atomic_fetch_or(atomic_short* __obj, short __v) |
| 5207 | { |
| 5208 | return atomic_fetch_or(const_cast<volatile atomic_short*>(__obj), __v); |
| 5209 | } |
| 5210 | |
| 5211 | inline _LIBCPP_INLINE_VISIBILITY |
| 5212 | short |
| 5213 | atomic_fetch_or_explicit(volatile atomic_short* __obj, short __v, |
| 5214 | memory_order __o) |
| 5215 | { |
| 5216 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 5217 | } |
| 5218 | |
| 5219 | inline _LIBCPP_INLINE_VISIBILITY |
| 5220 | short |
| 5221 | atomic_fetch_or_explicit(atomic_short* __obj, short __v, memory_order __o) |
| 5222 | { |
| 5223 | return atomic_fetch_or_explicit(const_cast<volatile atomic_short*>(__obj), |
| 5224 | __v, __o); |
| 5225 | } |
| 5226 | |
| 5227 | inline _LIBCPP_INLINE_VISIBILITY |
| 5228 | short |
| 5229 | atomic_fetch_xor(volatile atomic_short* __obj, short __v) |
| 5230 | { |
| 5231 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 5232 | } |
| 5233 | |
| 5234 | inline _LIBCPP_INLINE_VISIBILITY |
| 5235 | short |
| 5236 | atomic_fetch_xor(atomic_short* __obj, short __v) |
| 5237 | { |
| 5238 | return atomic_fetch_xor(const_cast<volatile atomic_short*>(__obj), __v); |
| 5239 | } |
| 5240 | |
| 5241 | inline _LIBCPP_INLINE_VISIBILITY |
| 5242 | short |
| 5243 | atomic_fetch_xor_explicit(volatile atomic_short* __obj, short __v, |
| 5244 | memory_order __o) |
| 5245 | { |
| 5246 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 5247 | } |
| 5248 | |
| 5249 | inline _LIBCPP_INLINE_VISIBILITY |
| 5250 | short |
| 5251 | atomic_fetch_xor_explicit(atomic_short* __obj, short __v, memory_order __o) |
| 5252 | { |
| 5253 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_short*>(__obj), |
| 5254 | __v, __o); |
| 5255 | } |
| 5256 | |
| 5257 | // atomic_ushort |
| 5258 | |
| 5259 | struct atomic_ushort; |
| 5260 | |
| 5261 | bool atomic_is_lock_free(const volatile atomic_ushort*); |
| 5262 | bool atomic_is_lock_free(const atomic_ushort*); |
| 5263 | void atomic_init(volatile atomic_ushort*, unsigned short); |
| 5264 | void atomic_init(atomic_ushort*, unsigned short); |
| 5265 | void atomic_store(volatile atomic_ushort*, unsigned short); |
| 5266 | void atomic_store(atomic_ushort*, unsigned short); |
| 5267 | void atomic_store_explicit(volatile atomic_ushort*, unsigned short, |
| 5268 | memory_order); |
| 5269 | void atomic_store_explicit(atomic_ushort*, unsigned short, memory_order); |
| 5270 | unsigned short atomic_load(const volatile atomic_ushort*); |
| 5271 | unsigned short atomic_load(const atomic_ushort*); |
| 5272 | unsigned short atomic_load_explicit(const volatile atomic_ushort*, |
| 5273 | memory_order); |
| 5274 | unsigned short atomic_load_explicit(const atomic_ushort*, memory_order); |
| 5275 | unsigned short atomic_exchange(volatile atomic_ushort*, unsigned short); |
| 5276 | unsigned short atomic_exchange(atomic_ushort*, unsigned short); |
| 5277 | unsigned short atomic_exchange_explicit(volatile atomic_ushort*, unsigned short, |
| 5278 | memory_order); |
| 5279 | unsigned short atomic_exchange_explicit(atomic_ushort*, unsigned short, |
| 5280 | memory_order); |
| 5281 | bool atomic_compare_exchange_weak(volatile atomic_ushort*, unsigned short*, |
| 5282 | unsigned short); |
| 5283 | bool atomic_compare_exchange_weak(atomic_ushort*, unsigned short*, |
| 5284 | unsigned short); |
| 5285 | bool atomic_compare_exchange_strong(volatile atomic_ushort*, unsigned short*, |
| 5286 | unsigned short); |
| 5287 | bool atomic_compare_exchange_strong(atomic_ushort*, unsigned short*, |
| 5288 | unsigned short); |
| 5289 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ushort*, |
| 5290 | unsigned short*, unsigned short, |
| 5291 | memory_order, memory_order); |
| 5292 | bool atomic_compare_exchange_weak_explicit(atomic_ushort*, unsigned short*, |
| 5293 | unsigned short, memory_order, |
| 5294 | memory_order); |
| 5295 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ushort*, |
| 5296 | unsigned short*, unsigned short, |
| 5297 | memory_order, memory_order); |
| 5298 | bool atomic_compare_exchange_strong_explicit(atomic_ushort*, unsigned short*, |
| 5299 | unsigned short, memory_order, |
| 5300 | memory_order); |
| 5301 | unsigned short atomic_fetch_add(volatile atomic_ushort*, unsigned short); |
| 5302 | unsigned short atomic_fetch_add(atomic_ushort*, unsigned short); |
| 5303 | unsigned short atomic_fetch_add_explicit(volatile atomic_ushort*, |
| 5304 | unsigned short, memory_order); |
| 5305 | unsigned short atomic_fetch_add_explicit(atomic_ushort*, unsigned short, |
| 5306 | memory_order); |
| 5307 | unsigned short atomic_fetch_sub(volatile atomic_ushort*, unsigned short); |
| 5308 | unsigned short atomic_fetch_sub(atomic_ushort*, unsigned short); |
| 5309 | unsigned short atomic_fetch_sub_explicit(volatile atomic_ushort*, |
| 5310 | unsigned short, memory_order); |
| 5311 | unsigned short atomic_fetch_sub_explicit(atomic_ushort*, unsigned short, |
| 5312 | memory_order); |
| 5313 | unsigned short atomic_fetch_and(volatile atomic_ushort*, unsigned short); |
| 5314 | unsigned short atomic_fetch_and(atomic_ushort*, unsigned short); |
| 5315 | unsigned short atomic_fetch_and_explicit(volatile atomic_ushort*, |
| 5316 | unsigned short, memory_order); |
| 5317 | unsigned short atomic_fetch_and_explicit(atomic_ushort*, unsigned short, |
| 5318 | memory_order); |
| 5319 | unsigned short atomic_fetch_or(volatile atomic_ushort*, unsigned short); |
| 5320 | unsigned short atomic_fetch_or(atomic_ushort*, unsigned short); |
| 5321 | unsigned short atomic_fetch_or_explicit(volatile atomic_ushort*, unsigned short, |
| 5322 | memory_order); |
| 5323 | unsigned short atomic_fetch_or_explicit(atomic_ushort*, unsigned short, |
| 5324 | memory_order); |
| 5325 | unsigned short atomic_fetch_xor(volatile atomic_ushort*, unsigned short); |
| 5326 | unsigned short atomic_fetch_xor(atomic_ushort*, unsigned short); |
| 5327 | unsigned short atomic_fetch_xor_explicit(volatile atomic_ushort*, |
| 5328 | unsigned short, memory_order); |
| 5329 | unsigned short atomic_fetch_xor_explicit(atomic_ushort*, unsigned short, |
| 5330 | memory_order); |
| 5331 | |
| 5332 | typedef struct atomic_ushort |
| 5333 | { |
| 5334 | unsigned short __v_; |
| 5335 | |
| 5336 | _LIBCPP_INLINE_VISIBILITY |
| 5337 | bool is_lock_free() const volatile |
| 5338 | {return atomic_is_lock_free(this);} |
| 5339 | _LIBCPP_INLINE_VISIBILITY |
| 5340 | bool is_lock_free() const |
| 5341 | {return atomic_is_lock_free(this);} |
| 5342 | _LIBCPP_INLINE_VISIBILITY |
| 5343 | void store(unsigned short __v, |
| 5344 | memory_order __o = memory_order_seq_cst) volatile |
| 5345 | {atomic_store_explicit(this, __v, __o);} |
| 5346 | _LIBCPP_INLINE_VISIBILITY |
| 5347 | void store(unsigned short __v, memory_order __o = memory_order_seq_cst) |
| 5348 | {atomic_store_explicit(this, __v, __o);} |
| 5349 | _LIBCPP_INLINE_VISIBILITY |
| 5350 | unsigned short load(memory_order __o = memory_order_seq_cst) const volatile |
| 5351 | {return atomic_load_explicit(this, __o);} |
| 5352 | _LIBCPP_INLINE_VISIBILITY |
| 5353 | unsigned short load(memory_order __o = memory_order_seq_cst) const |
| 5354 | {return atomic_load_explicit(this, __o);} |
| 5355 | _LIBCPP_INLINE_VISIBILITY |
| 5356 | operator unsigned short() const volatile |
| 5357 | {return load();} |
| 5358 | _LIBCPP_INLINE_VISIBILITY |
| 5359 | operator unsigned short() const |
| 5360 | {return load();} |
| 5361 | _LIBCPP_INLINE_VISIBILITY |
| 5362 | unsigned short exchange(unsigned short __v, |
| 5363 | memory_order __o = memory_order_seq_cst) volatile |
| 5364 | {return atomic_exchange_explicit(this, __v, __o);} |
| 5365 | _LIBCPP_INLINE_VISIBILITY |
| 5366 | unsigned short exchange(unsigned short __v, |
| 5367 | memory_order __o = memory_order_seq_cst) |
| 5368 | {return atomic_exchange_explicit(this, __v, __o);} |
| 5369 | _LIBCPP_INLINE_VISIBILITY |
| 5370 | bool compare_exchange_weak(unsigned short& __v, unsigned short __e, |
| 5371 | memory_order __s, memory_order __f) volatile |
| 5372 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5373 | __f);} |
| 5374 | _LIBCPP_INLINE_VISIBILITY |
| 5375 | bool compare_exchange_weak(unsigned short& __v, unsigned short __e, |
| 5376 | memory_order __s, memory_order __f) |
| 5377 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5378 | __f);} |
| 5379 | _LIBCPP_INLINE_VISIBILITY |
| 5380 | bool compare_exchange_strong(unsigned short& __v, unsigned short __e, |
| 5381 | memory_order __s, memory_order __f) volatile |
| 5382 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5383 | __f);} |
| 5384 | _LIBCPP_INLINE_VISIBILITY |
| 5385 | bool compare_exchange_strong(unsigned short& __v, unsigned short __e, |
| 5386 | memory_order __s, memory_order __f) |
| 5387 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5388 | __f);} |
| 5389 | _LIBCPP_INLINE_VISIBILITY |
| 5390 | bool compare_exchange_weak(unsigned short& __v, unsigned short __e, |
| 5391 | memory_order __s = memory_order_seq_cst) volatile |
| 5392 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5393 | __translate_memory_order(__s));} |
| 5394 | _LIBCPP_INLINE_VISIBILITY |
| 5395 | bool compare_exchange_weak(unsigned short& __v, unsigned short __e, |
| 5396 | memory_order __s = memory_order_seq_cst) |
| 5397 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5398 | __translate_memory_order(__s));} |
| 5399 | _LIBCPP_INLINE_VISIBILITY |
| 5400 | bool compare_exchange_strong(unsigned short& __v, unsigned short __e, |
| 5401 | memory_order __s = memory_order_seq_cst) volatile |
| 5402 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5403 | __translate_memory_order(__s));} |
| 5404 | _LIBCPP_INLINE_VISIBILITY |
| 5405 | bool compare_exchange_strong(unsigned short& __v, unsigned short __e, |
| 5406 | memory_order __s = memory_order_seq_cst) |
| 5407 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5408 | __translate_memory_order(__s));} |
| 5409 | _LIBCPP_INLINE_VISIBILITY |
| 5410 | unsigned short fetch_add(unsigned short __v, |
| 5411 | memory_order __o = memory_order_seq_cst) volatile |
| 5412 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 5413 | _LIBCPP_INLINE_VISIBILITY |
| 5414 | unsigned short fetch_add(unsigned short __v, |
| 5415 | memory_order __o = memory_order_seq_cst) |
| 5416 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 5417 | _LIBCPP_INLINE_VISIBILITY |
| 5418 | unsigned short fetch_sub(unsigned short __v, |
| 5419 | memory_order __o = memory_order_seq_cst) volatile |
| 5420 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 5421 | _LIBCPP_INLINE_VISIBILITY |
| 5422 | unsigned short fetch_sub(unsigned short __v, |
| 5423 | memory_order __o = memory_order_seq_cst) |
| 5424 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 5425 | _LIBCPP_INLINE_VISIBILITY |
| 5426 | unsigned short fetch_and(unsigned short __v, |
| 5427 | memory_order __o = memory_order_seq_cst) volatile |
| 5428 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 5429 | _LIBCPP_INLINE_VISIBILITY |
| 5430 | unsigned short fetch_and(unsigned short __v, |
| 5431 | memory_order __o = memory_order_seq_cst) |
| 5432 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 5433 | _LIBCPP_INLINE_VISIBILITY |
| 5434 | unsigned short fetch_or(unsigned short __v, |
| 5435 | memory_order __o = memory_order_seq_cst) volatile |
| 5436 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 5437 | _LIBCPP_INLINE_VISIBILITY |
| 5438 | unsigned short fetch_or(unsigned short __v, |
| 5439 | memory_order __o = memory_order_seq_cst) |
| 5440 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 5441 | _LIBCPP_INLINE_VISIBILITY |
| 5442 | unsigned short fetch_xor(unsigned short __v, |
| 5443 | memory_order __o = memory_order_seq_cst) volatile |
| 5444 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 5445 | _LIBCPP_INLINE_VISIBILITY |
| 5446 | unsigned short fetch_xor(unsigned short __v, |
| 5447 | memory_order __o = memory_order_seq_cst) |
| 5448 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 5449 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 5450 | atomic_ushort() = default; |
| 5451 | #else |
| 5452 | _LIBCPP_INLINE_VISIBILITY |
| 5453 | atomic_ushort() {} |
| 5454 | #endif |
| 5455 | _LIBCPP_INLINE_VISIBILITY |
| 5456 | /*constexpr*/ atomic_ushort(unsigned short __v) |
| 5457 | : __v_(__v) {} |
| 5458 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 5459 | atomic_ushort(const atomic_ushort&) = delete; |
| 5460 | atomic_ushort& operator=(const atomic_ushort&) = delete; |
| 5461 | atomic_ushort& operator=(const atomic_ushort&) volatile = delete; |
| 5462 | #else |
| 5463 | private: |
| 5464 | atomic_ushort(const atomic_ushort&); |
| 5465 | atomic_ushort& operator=(const atomic_ushort&); |
| 5466 | atomic_ushort& operator=(const atomic_ushort&) volatile; |
| 5467 | public: |
| 5468 | #endif |
| 5469 | _LIBCPP_INLINE_VISIBILITY |
| 5470 | unsigned short operator=(unsigned short __v) volatile |
| 5471 | {store(__v); return __v;} |
| 5472 | _LIBCPP_INLINE_VISIBILITY |
| 5473 | unsigned short operator=(unsigned short __v) |
| 5474 | {store(__v); return __v;} |
| 5475 | _LIBCPP_INLINE_VISIBILITY |
| 5476 | unsigned short operator++(int) volatile |
| 5477 | {typedef unsigned short type; return fetch_add(type(1));} |
| 5478 | _LIBCPP_INLINE_VISIBILITY |
| 5479 | short operator++(int) |
| 5480 | {typedef unsigned short type; return fetch_add(type(1));} |
| 5481 | _LIBCPP_INLINE_VISIBILITY |
| 5482 | short operator--(int) volatile |
| 5483 | {typedef unsigned short type; return fetch_sub(type(1));} |
| 5484 | _LIBCPP_INLINE_VISIBILITY |
| 5485 | short operator--(int) |
| 5486 | {typedef unsigned short type; return fetch_sub(type(1));} |
| 5487 | _LIBCPP_INLINE_VISIBILITY |
| 5488 | short operator++() volatile |
| 5489 | {typedef unsigned short type; return type(fetch_add(type(1)) + 1);} |
| 5490 | _LIBCPP_INLINE_VISIBILITY |
| 5491 | short operator++() |
| 5492 | {typedef unsigned short type; return type(fetch_add(type(1)) + 1);} |
| 5493 | _LIBCPP_INLINE_VISIBILITY |
| 5494 | short operator--() volatile |
| 5495 | {typedef unsigned short type; return type(fetch_sub(type(1)) - 1);} |
| 5496 | _LIBCPP_INLINE_VISIBILITY |
| 5497 | short operator--() |
| 5498 | {typedef unsigned short type; return type(fetch_sub(type(1)) - 1);} |
| 5499 | _LIBCPP_INLINE_VISIBILITY |
| 5500 | short operator+=(short __v) volatile |
| 5501 | {typedef unsigned short type; return type(fetch_add(__v) + __v);} |
| 5502 | _LIBCPP_INLINE_VISIBILITY |
| 5503 | short operator+=(short __v) |
| 5504 | {typedef unsigned short type; return type(fetch_add(__v) + __v);} |
| 5505 | _LIBCPP_INLINE_VISIBILITY |
| 5506 | short operator-=(short __v) volatile |
| 5507 | {typedef unsigned short type; return type(fetch_sub(__v) - __v);} |
| 5508 | _LIBCPP_INLINE_VISIBILITY |
| 5509 | short operator-=(short __v) |
| 5510 | {typedef unsigned short type; return type(fetch_sub(__v) - __v);} |
| 5511 | _LIBCPP_INLINE_VISIBILITY |
| 5512 | short operator&=(short __v) volatile |
| 5513 | {typedef unsigned short type; return type(fetch_and(__v) & __v);} |
| 5514 | _LIBCPP_INLINE_VISIBILITY |
| 5515 | short operator&=(short __v) |
| 5516 | {typedef unsigned short type; return type(fetch_and(__v) & __v);} |
| 5517 | _LIBCPP_INLINE_VISIBILITY |
| 5518 | short operator|=(short __v) volatile |
| 5519 | {typedef unsigned short type; return type(fetch_or(__v) | __v);} |
| 5520 | _LIBCPP_INLINE_VISIBILITY |
| 5521 | short operator|=(short __v) |
| 5522 | {typedef unsigned short type; return type(fetch_or(__v) | __v);} |
| 5523 | _LIBCPP_INLINE_VISIBILITY |
| 5524 | short operator^=(short __v) volatile |
| 5525 | {typedef unsigned short type; return type(fetch_xor(__v) ^ __v);} |
| 5526 | _LIBCPP_INLINE_VISIBILITY |
| 5527 | short operator^=(short __v) |
| 5528 | {typedef unsigned short type; return type(fetch_xor(__v) ^ __v);} |
| 5529 | } atomic_ushort; |
| 5530 | |
| 5531 | inline _LIBCPP_INLINE_VISIBILITY |
| 5532 | bool |
| 5533 | atomic_is_lock_free(const volatile atomic_ushort*) |
| 5534 | { |
| 5535 | typedef unsigned short type; |
| 5536 | return __atomic_is_lock_free(type); |
| 5537 | } |
| 5538 | |
| 5539 | inline _LIBCPP_INLINE_VISIBILITY |
| 5540 | bool |
| 5541 | atomic_is_lock_free(const atomic_ushort* __obj) |
| 5542 | { |
| 5543 | return atomic_is_lock_free(const_cast<volatile atomic_ushort*>(__obj)); |
| 5544 | } |
| 5545 | |
| 5546 | inline _LIBCPP_INLINE_VISIBILITY |
| 5547 | void |
| 5548 | atomic_init(volatile atomic_ushort* __obj, unsigned short __desr) |
| 5549 | { |
| 5550 | __obj->__v_ = __desr; |
| 5551 | } |
| 5552 | |
| 5553 | inline _LIBCPP_INLINE_VISIBILITY |
| 5554 | void |
| 5555 | atomic_init(atomic_ushort* __obj, unsigned short __desr) |
| 5556 | { |
| 5557 | __obj->__v_ = __desr; |
| 5558 | } |
| 5559 | |
| 5560 | inline _LIBCPP_INLINE_VISIBILITY |
| 5561 | void |
| 5562 | atomic_store(volatile atomic_ushort* __obj, unsigned short __desr) |
| 5563 | { |
| 5564 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 5565 | } |
| 5566 | |
| 5567 | inline _LIBCPP_INLINE_VISIBILITY |
| 5568 | void |
| 5569 | atomic_store(atomic_ushort* __obj, unsigned short __desr) |
| 5570 | { |
| 5571 | atomic_store(const_cast<volatile atomic_ushort*>(__obj), __desr); |
| 5572 | } |
| 5573 | |
| 5574 | inline _LIBCPP_INLINE_VISIBILITY |
| 5575 | void |
| 5576 | atomic_store_explicit(volatile atomic_ushort* __obj, unsigned short __desr, |
| 5577 | memory_order __o) |
| 5578 | { |
| 5579 | __atomic_store(&__obj->__v_, __desr, __o); |
| 5580 | } |
| 5581 | |
| 5582 | inline _LIBCPP_INLINE_VISIBILITY |
| 5583 | void |
| 5584 | atomic_store_explicit(atomic_ushort* __obj, unsigned short __desr, |
| 5585 | memory_order __o) |
| 5586 | { |
| 5587 | atomic_store_explicit(const_cast<volatile atomic_ushort*>(__obj), __desr, |
| 5588 | __o); |
| 5589 | } |
| 5590 | |
| 5591 | inline _LIBCPP_INLINE_VISIBILITY |
| 5592 | unsigned short |
| 5593 | atomic_load(const volatile atomic_ushort* __obj) |
| 5594 | { |
| 5595 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 5596 | } |
| 5597 | |
| 5598 | inline _LIBCPP_INLINE_VISIBILITY |
| 5599 | unsigned short |
| 5600 | atomic_load(const atomic_ushort* __obj) |
| 5601 | { |
| 5602 | return atomic_load(const_cast<const volatile atomic_ushort*>(__obj)); |
| 5603 | } |
| 5604 | |
| 5605 | inline _LIBCPP_INLINE_VISIBILITY |
| 5606 | unsigned short |
| 5607 | atomic_load_explicit(const volatile atomic_ushort* __obj, memory_order __o) |
| 5608 | { |
| 5609 | return __atomic_load(&__obj->__v_, __o); |
| 5610 | } |
| 5611 | |
| 5612 | inline _LIBCPP_INLINE_VISIBILITY |
| 5613 | unsigned short |
| 5614 | atomic_load_explicit(const atomic_ushort* __obj, memory_order __o) |
| 5615 | { |
| 5616 | return atomic_load_explicit(const_cast<const volatile atomic_ushort*> |
| 5617 | (__obj), __o); |
| 5618 | } |
| 5619 | |
| 5620 | inline _LIBCPP_INLINE_VISIBILITY |
| 5621 | unsigned short |
| 5622 | atomic_exchange(volatile atomic_ushort* __obj, unsigned short __desr) |
| 5623 | { |
| 5624 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 5625 | } |
| 5626 | |
| 5627 | inline _LIBCPP_INLINE_VISIBILITY |
| 5628 | unsigned short |
| 5629 | atomic_exchange(atomic_ushort* __obj, unsigned short __desr) |
| 5630 | { |
| 5631 | return atomic_exchange(const_cast<volatile atomic_ushort*>(__obj), __desr); |
| 5632 | } |
| 5633 | |
| 5634 | inline _LIBCPP_INLINE_VISIBILITY |
| 5635 | unsigned short |
| 5636 | atomic_exchange_explicit(volatile atomic_ushort* __obj, unsigned short __desr, |
| 5637 | memory_order __o) |
| 5638 | { |
| 5639 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 5640 | } |
| 5641 | |
| 5642 | inline _LIBCPP_INLINE_VISIBILITY |
| 5643 | unsigned short |
| 5644 | atomic_exchange_explicit(atomic_ushort* __obj, unsigned short __desr, |
| 5645 | memory_order __o) |
| 5646 | { |
| 5647 | return atomic_exchange_explicit(const_cast<volatile atomic_ushort*> |
| 5648 | (__obj), __desr, __o); |
| 5649 | } |
| 5650 | |
| 5651 | inline _LIBCPP_INLINE_VISIBILITY |
| 5652 | bool |
| 5653 | atomic_compare_exchange_weak(volatile atomic_ushort* __obj, |
| 5654 | unsigned short* __exp, unsigned short __desr) |
| 5655 | { |
| 5656 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 5657 | memory_order_seq_cst, memory_order_seq_cst); |
| 5658 | } |
| 5659 | |
| 5660 | inline _LIBCPP_INLINE_VISIBILITY |
| 5661 | bool |
| 5662 | atomic_compare_exchange_weak(atomic_ushort* __obj, unsigned short* __exp, |
| 5663 | unsigned short __desr) |
| 5664 | { |
| 5665 | return atomic_compare_exchange_weak(const_cast<volatile atomic_ushort*> |
| 5666 | (__obj), __exp, __desr); |
| 5667 | } |
| 5668 | |
| 5669 | inline _LIBCPP_INLINE_VISIBILITY |
| 5670 | bool |
| 5671 | atomic_compare_exchange_strong(volatile atomic_ushort* __obj, |
| 5672 | unsigned short* __exp, unsigned short __desr) |
| 5673 | { |
| 5674 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 5675 | memory_order_seq_cst, memory_order_seq_cst); |
| 5676 | } |
| 5677 | |
| 5678 | inline _LIBCPP_INLINE_VISIBILITY |
| 5679 | bool |
| 5680 | atomic_compare_exchange_strong(atomic_ushort* __obj, unsigned short* __exp, |
| 5681 | unsigned short __desr) |
| 5682 | { |
| 5683 | return atomic_compare_exchange_strong(const_cast<volatile atomic_ushort*> |
| 5684 | (__obj), __exp, __desr); |
| 5685 | } |
| 5686 | |
| 5687 | inline _LIBCPP_INLINE_VISIBILITY |
| 5688 | bool |
| 5689 | atomic_compare_exchange_weak_explicit(volatile atomic_ushort* __obj, |
| 5690 | unsigned short* __exp, |
| 5691 | unsigned short __desr, memory_order __s, |
| 5692 | memory_order __f) |
| 5693 | { |
| 5694 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 5695 | __f); |
| 5696 | } |
| 5697 | |
| 5698 | inline _LIBCPP_INLINE_VISIBILITY |
| 5699 | bool |
| 5700 | atomic_compare_exchange_weak_explicit(atomic_ushort* __obj, |
| 5701 | unsigned short* __exp, |
| 5702 | unsigned short __desr, memory_order __s, |
| 5703 | memory_order __f) |
| 5704 | { |
| 5705 | return atomic_compare_exchange_weak_explicit( |
| 5706 | const_cast<volatile atomic_ushort*>(__obj), __exp, __desr, __s, __f); |
| 5707 | } |
| 5708 | |
| 5709 | inline _LIBCPP_INLINE_VISIBILITY |
| 5710 | bool |
| 5711 | atomic_compare_exchange_strong_explicit(volatile atomic_ushort* __obj, |
| 5712 | unsigned short* __exp, |
| 5713 | unsigned short __desr, memory_order __s, |
| 5714 | memory_order __f) |
| 5715 | { |
| 5716 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 5717 | __f); |
| 5718 | } |
| 5719 | |
| 5720 | inline _LIBCPP_INLINE_VISIBILITY |
| 5721 | bool |
| 5722 | atomic_compare_exchange_strong_explicit(atomic_ushort* __obj, |
| 5723 | unsigned short* __exp, |
| 5724 | unsigned short __desr, memory_order __s, |
| 5725 | memory_order __f) |
| 5726 | { |
| 5727 | return atomic_compare_exchange_strong_explicit( |
| 5728 | const_cast<volatile atomic_ushort*>(__obj), __exp, __desr, __s, __f); |
| 5729 | } |
| 5730 | |
| 5731 | inline _LIBCPP_INLINE_VISIBILITY |
| 5732 | unsigned short |
| 5733 | atomic_fetch_add(volatile atomic_ushort* __obj, unsigned short __v) |
| 5734 | { |
| 5735 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 5736 | } |
| 5737 | |
| 5738 | inline _LIBCPP_INLINE_VISIBILITY |
| 5739 | unsigned short |
| 5740 | atomic_fetch_add(atomic_ushort* __obj, unsigned short __v) |
| 5741 | { |
| 5742 | return atomic_fetch_add(const_cast<volatile atomic_ushort*>(__obj), __v); |
| 5743 | } |
| 5744 | |
| 5745 | inline _LIBCPP_INLINE_VISIBILITY |
| 5746 | unsigned short |
| 5747 | atomic_fetch_add_explicit(volatile atomic_ushort* __obj, unsigned short __v, |
| 5748 | memory_order __o) |
| 5749 | { |
| 5750 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 5751 | } |
| 5752 | |
| 5753 | inline _LIBCPP_INLINE_VISIBILITY |
| 5754 | unsigned short |
| 5755 | atomic_fetch_add_explicit(atomic_ushort* __obj, unsigned short __v, |
| 5756 | memory_order __o) |
| 5757 | { |
| 5758 | return atomic_fetch_add_explicit(const_cast<volatile atomic_ushort*>(__obj), |
| 5759 | __v, __o); |
| 5760 | } |
| 5761 | |
| 5762 | inline _LIBCPP_INLINE_VISIBILITY |
| 5763 | unsigned short |
| 5764 | atomic_fetch_sub(volatile atomic_ushort* __obj, unsigned short __v) |
| 5765 | { |
| 5766 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 5767 | } |
| 5768 | |
| 5769 | inline _LIBCPP_INLINE_VISIBILITY |
| 5770 | unsigned short |
| 5771 | atomic_fetch_sub(atomic_ushort* __obj, unsigned short __v) |
| 5772 | { |
| 5773 | return atomic_fetch_sub(const_cast<volatile atomic_ushort*>(__obj), __v); |
| 5774 | } |
| 5775 | |
| 5776 | inline _LIBCPP_INLINE_VISIBILITY |
| 5777 | unsigned short |
| 5778 | atomic_fetch_sub_explicit(volatile atomic_ushort* __obj, unsigned short __v, |
| 5779 | memory_order __o) |
| 5780 | { |
| 5781 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 5782 | } |
| 5783 | |
| 5784 | inline _LIBCPP_INLINE_VISIBILITY |
| 5785 | unsigned short |
| 5786 | atomic_fetch_sub_explicit(atomic_ushort* __obj, unsigned short __v, |
| 5787 | memory_order __o) |
| 5788 | { |
| 5789 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_ushort*>(__obj), |
| 5790 | __v, __o); |
| 5791 | } |
| 5792 | |
| 5793 | inline _LIBCPP_INLINE_VISIBILITY |
| 5794 | unsigned short |
| 5795 | atomic_fetch_and(volatile atomic_ushort* __obj, unsigned short __v) |
| 5796 | { |
| 5797 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 5798 | } |
| 5799 | |
| 5800 | inline _LIBCPP_INLINE_VISIBILITY |
| 5801 | unsigned short |
| 5802 | atomic_fetch_and(atomic_ushort* __obj, unsigned short __v) |
| 5803 | { |
| 5804 | return atomic_fetch_and(const_cast<volatile atomic_ushort*>(__obj), __v); |
| 5805 | } |
| 5806 | |
| 5807 | inline _LIBCPP_INLINE_VISIBILITY |
| 5808 | unsigned short |
| 5809 | atomic_fetch_and_explicit(volatile atomic_ushort* __obj, unsigned short __v, |
| 5810 | memory_order __o) |
| 5811 | { |
| 5812 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 5813 | } |
| 5814 | |
| 5815 | inline _LIBCPP_INLINE_VISIBILITY |
| 5816 | unsigned short |
| 5817 | atomic_fetch_and_explicit(atomic_ushort* __obj, unsigned short __v, |
| 5818 | memory_order __o) |
| 5819 | { |
| 5820 | return atomic_fetch_and_explicit(const_cast<volatile atomic_ushort*>(__obj), |
| 5821 | __v, __o); |
| 5822 | } |
| 5823 | |
| 5824 | inline _LIBCPP_INLINE_VISIBILITY |
| 5825 | unsigned short |
| 5826 | atomic_fetch_or(volatile atomic_ushort* __obj, unsigned short __v) |
| 5827 | { |
| 5828 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 5829 | } |
| 5830 | |
| 5831 | inline _LIBCPP_INLINE_VISIBILITY |
| 5832 | unsigned short |
| 5833 | atomic_fetch_or(atomic_ushort* __obj, unsigned short __v) |
| 5834 | { |
| 5835 | return atomic_fetch_or(const_cast<volatile atomic_ushort*>(__obj), __v); |
| 5836 | } |
| 5837 | |
| 5838 | inline _LIBCPP_INLINE_VISIBILITY |
| 5839 | unsigned short |
| 5840 | atomic_fetch_or_explicit(volatile atomic_ushort* __obj, unsigned short __v, |
| 5841 | memory_order __o) |
| 5842 | { |
| 5843 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 5844 | } |
| 5845 | |
| 5846 | inline _LIBCPP_INLINE_VISIBILITY |
| 5847 | unsigned short |
| 5848 | atomic_fetch_or_explicit(atomic_ushort* __obj, unsigned short __v, |
| 5849 | memory_order __o) |
| 5850 | { |
| 5851 | return atomic_fetch_or_explicit(const_cast<volatile atomic_ushort*>(__obj), |
| 5852 | __v, __o); |
| 5853 | } |
| 5854 | |
| 5855 | inline _LIBCPP_INLINE_VISIBILITY |
| 5856 | unsigned short |
| 5857 | atomic_fetch_xor(volatile atomic_ushort* __obj, unsigned short __v) |
| 5858 | { |
| 5859 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 5860 | } |
| 5861 | |
| 5862 | inline _LIBCPP_INLINE_VISIBILITY |
| 5863 | unsigned short |
| 5864 | atomic_fetch_xor(atomic_ushort* __obj, unsigned short __v) |
| 5865 | { |
| 5866 | return atomic_fetch_xor(const_cast<volatile atomic_ushort*>(__obj), __v); |
| 5867 | } |
| 5868 | |
| 5869 | inline _LIBCPP_INLINE_VISIBILITY |
| 5870 | unsigned short |
| 5871 | atomic_fetch_xor_explicit(volatile atomic_ushort* __obj, unsigned short __v, |
| 5872 | memory_order __o) |
| 5873 | { |
| 5874 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 5875 | } |
| 5876 | |
| 5877 | inline _LIBCPP_INLINE_VISIBILITY |
| 5878 | unsigned short |
| 5879 | atomic_fetch_xor_explicit(atomic_ushort* __obj, unsigned short __v, |
| 5880 | memory_order __o) |
| 5881 | { |
| 5882 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_ushort*>(__obj), |
| 5883 | __v, __o); |
| 5884 | } |
| 5885 | |
| 5886 | // atomic_int |
| 5887 | |
| 5888 | struct atomic_int; |
| 5889 | |
| 5890 | bool atomic_is_lock_free(const volatile atomic_int*); |
| 5891 | bool atomic_is_lock_free(const atomic_int*); |
| 5892 | void atomic_init(volatile atomic_int*, int); |
| 5893 | void atomic_init(atomic_int*, int); |
| 5894 | void atomic_store(volatile atomic_int*, int); |
| 5895 | void atomic_store(atomic_int*, int); |
| 5896 | void atomic_store_explicit(volatile atomic_int*, int, memory_order); |
| 5897 | void atomic_store_explicit(atomic_int*, int, memory_order); |
| 5898 | int atomic_load(const volatile atomic_int*); |
| 5899 | int atomic_load(const atomic_int*); |
| 5900 | int atomic_load_explicit(const volatile atomic_int*, memory_order); |
| 5901 | int atomic_load_explicit(const atomic_int*, memory_order); |
| 5902 | int atomic_exchange(volatile atomic_int*, int); |
| 5903 | int atomic_exchange(atomic_int*, int); |
| 5904 | int atomic_exchange_explicit(volatile atomic_int*, int, memory_order); |
| 5905 | int atomic_exchange_explicit(atomic_int*, int, memory_order); |
| 5906 | bool atomic_compare_exchange_weak(volatile atomic_int*, int*, int); |
| 5907 | bool atomic_compare_exchange_weak(atomic_int*, int*, int); |
| 5908 | bool atomic_compare_exchange_strong(volatile atomic_int*, int*, int); |
| 5909 | bool atomic_compare_exchange_strong(atomic_int*, int*, int); |
| 5910 | bool atomic_compare_exchange_weak_explicit(volatile atomic_int*, int*, int, |
| 5911 | memory_order, memory_order); |
| 5912 | bool atomic_compare_exchange_weak_explicit(atomic_int*, int*, int, |
| 5913 | memory_order, memory_order); |
| 5914 | bool atomic_compare_exchange_strong_explicit(volatile atomic_int*, int*, int, |
| 5915 | memory_order, memory_order); |
| 5916 | bool atomic_compare_exchange_strong_explicit(atomic_int*, int*, int, |
| 5917 | memory_order, memory_order); |
| 5918 | int atomic_fetch_add(volatile atomic_int*, int); |
| 5919 | int atomic_fetch_add(atomic_int*, int); |
| 5920 | int atomic_fetch_add_explicit(volatile atomic_int*, int, memory_order); |
| 5921 | int atomic_fetch_add_explicit(atomic_int*, int, memory_order); |
| 5922 | int atomic_fetch_sub(volatile atomic_int*, int); |
| 5923 | int atomic_fetch_sub(atomic_int*, int); |
| 5924 | int atomic_fetch_sub_explicit(volatile atomic_int*, int, memory_order); |
| 5925 | int atomic_fetch_sub_explicit(atomic_int*, int, memory_order); |
| 5926 | int atomic_fetch_and(volatile atomic_int*, int); |
| 5927 | int atomic_fetch_and(atomic_int*, int); |
| 5928 | int atomic_fetch_and_explicit(volatile atomic_int*, int, memory_order); |
| 5929 | int atomic_fetch_and_explicit(atomic_int*, int, memory_order); |
| 5930 | int atomic_fetch_or(volatile atomic_int*, int); |
| 5931 | int atomic_fetch_or(atomic_int*, int); |
| 5932 | int atomic_fetch_or_explicit(volatile atomic_int*, int, memory_order); |
| 5933 | int atomic_fetch_or_explicit(atomic_int*, int, memory_order); |
| 5934 | int atomic_fetch_xor(volatile atomic_int*, int); |
| 5935 | int atomic_fetch_xor(atomic_int*, int); |
| 5936 | int atomic_fetch_xor_explicit(volatile atomic_int*, int, memory_order); |
| 5937 | int atomic_fetch_xor_explicit(atomic_int*, int, memory_order); |
| 5938 | |
| 5939 | typedef struct atomic_int |
| 5940 | { |
| 5941 | int __v_; |
| 5942 | |
| 5943 | _LIBCPP_INLINE_VISIBILITY |
| 5944 | bool is_lock_free() const volatile |
| 5945 | {return atomic_is_lock_free(this);} |
| 5946 | _LIBCPP_INLINE_VISIBILITY |
| 5947 | bool is_lock_free() const |
| 5948 | {return atomic_is_lock_free(this);} |
| 5949 | _LIBCPP_INLINE_VISIBILITY |
| 5950 | void store(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 5951 | {atomic_store_explicit(this, __v, __o);} |
| 5952 | _LIBCPP_INLINE_VISIBILITY |
| 5953 | void store(int __v, memory_order __o = memory_order_seq_cst) |
| 5954 | {atomic_store_explicit(this, __v, __o);} |
| 5955 | _LIBCPP_INLINE_VISIBILITY |
| 5956 | int load(memory_order __o = memory_order_seq_cst) const volatile |
| 5957 | {return atomic_load_explicit(this, __o);} |
| 5958 | _LIBCPP_INLINE_VISIBILITY |
| 5959 | int load(memory_order __o = memory_order_seq_cst) const |
| 5960 | {return atomic_load_explicit(this, __o);} |
| 5961 | _LIBCPP_INLINE_VISIBILITY |
| 5962 | operator int() const volatile |
| 5963 | {return load();} |
| 5964 | _LIBCPP_INLINE_VISIBILITY |
| 5965 | operator int() const |
| 5966 | {return load();} |
| 5967 | _LIBCPP_INLINE_VISIBILITY |
| 5968 | int exchange(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 5969 | {return atomic_exchange_explicit(this, __v, __o);} |
| 5970 | _LIBCPP_INLINE_VISIBILITY |
| 5971 | int exchange(int __v, memory_order __o = memory_order_seq_cst) |
| 5972 | {return atomic_exchange_explicit(this, __v, __o);} |
| 5973 | _LIBCPP_INLINE_VISIBILITY |
| 5974 | bool compare_exchange_weak(int& __v, int __e, memory_order __s, |
| 5975 | memory_order __f) volatile |
| 5976 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5977 | __f);} |
| 5978 | _LIBCPP_INLINE_VISIBILITY |
| 5979 | bool compare_exchange_weak(int& __v, int __e, memory_order __s, |
| 5980 | memory_order __f) |
| 5981 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5982 | __f);} |
| 5983 | _LIBCPP_INLINE_VISIBILITY |
| 5984 | bool compare_exchange_strong(int& __v, int __e, memory_order __s, |
| 5985 | memory_order __f) volatile |
| 5986 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5987 | __f);} |
| 5988 | _LIBCPP_INLINE_VISIBILITY |
| 5989 | bool compare_exchange_strong(int& __v, int __e, memory_order __s, |
| 5990 | memory_order __f) |
| 5991 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 5992 | __f);} |
| 5993 | _LIBCPP_INLINE_VISIBILITY |
| 5994 | bool compare_exchange_weak(int& __v, int __e, |
| 5995 | memory_order __s = memory_order_seq_cst) volatile |
| 5996 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 5997 | __translate_memory_order(__s));} |
| 5998 | _LIBCPP_INLINE_VISIBILITY |
| 5999 | bool compare_exchange_weak(int& __v, int __e, |
| 6000 | memory_order __s = memory_order_seq_cst) |
| 6001 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 6002 | __translate_memory_order(__s));} |
| 6003 | _LIBCPP_INLINE_VISIBILITY |
| 6004 | bool compare_exchange_strong(int& __v, int __e, |
| 6005 | memory_order __s = memory_order_seq_cst) volatile |
| 6006 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6007 | __translate_memory_order(__s));} |
| 6008 | _LIBCPP_INLINE_VISIBILITY |
| 6009 | bool compare_exchange_strong(int& __v, int __e, |
| 6010 | memory_order __s = memory_order_seq_cst) |
| 6011 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6012 | __translate_memory_order(__s));} |
| 6013 | _LIBCPP_INLINE_VISIBILITY |
| 6014 | int fetch_add(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 6015 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 6016 | _LIBCPP_INLINE_VISIBILITY |
| 6017 | int fetch_add(int __v, memory_order __o = memory_order_seq_cst) |
| 6018 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 6019 | _LIBCPP_INLINE_VISIBILITY |
| 6020 | int fetch_sub(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 6021 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 6022 | _LIBCPP_INLINE_VISIBILITY |
| 6023 | int fetch_sub(int __v, memory_order __o = memory_order_seq_cst) |
| 6024 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 6025 | _LIBCPP_INLINE_VISIBILITY |
| 6026 | int fetch_and(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 6027 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 6028 | _LIBCPP_INLINE_VISIBILITY |
| 6029 | int fetch_and(int __v, memory_order __o = memory_order_seq_cst) |
| 6030 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 6031 | _LIBCPP_INLINE_VISIBILITY |
| 6032 | int fetch_or(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 6033 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 6034 | _LIBCPP_INLINE_VISIBILITY |
| 6035 | int fetch_or(int __v, memory_order __o = memory_order_seq_cst) |
| 6036 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 6037 | _LIBCPP_INLINE_VISIBILITY |
| 6038 | int fetch_xor(int __v, memory_order __o = memory_order_seq_cst) volatile |
| 6039 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 6040 | _LIBCPP_INLINE_VISIBILITY |
| 6041 | int fetch_xor(int __v, memory_order __o = memory_order_seq_cst) |
| 6042 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 6043 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 6044 | atomic_int() = default; |
| 6045 | #else |
| 6046 | _LIBCPP_INLINE_VISIBILITY |
| 6047 | atomic_int() {} |
| 6048 | #endif |
| 6049 | _LIBCPP_INLINE_VISIBILITY |
| 6050 | /*constexpr*/ atomic_int(int __v) |
| 6051 | : __v_(__v) {} |
| 6052 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 6053 | atomic_int(const atomic_int&) = delete; |
| 6054 | atomic_int& operator=(const atomic_int&) = delete; |
| 6055 | atomic_int& operator=(const atomic_int&) volatile = delete; |
| 6056 | #else |
| 6057 | private: |
| 6058 | atomic_int(const atomic_int&); |
| 6059 | atomic_int& operator=(const atomic_int&); |
| 6060 | atomic_int& operator=(const atomic_int&) volatile; |
| 6061 | public: |
| 6062 | #endif |
| 6063 | _LIBCPP_INLINE_VISIBILITY |
| 6064 | int operator=(int __v) volatile |
| 6065 | {store(__v); return __v;} |
| 6066 | _LIBCPP_INLINE_VISIBILITY |
| 6067 | int operator=(int __v) |
| 6068 | {store(__v); return __v;} |
| 6069 | _LIBCPP_INLINE_VISIBILITY |
| 6070 | int operator++(int) volatile |
| 6071 | {return fetch_add(int(1));} |
| 6072 | _LIBCPP_INLINE_VISIBILITY |
| 6073 | int operator++(int) |
| 6074 | {return fetch_add(int(1));} |
| 6075 | _LIBCPP_INLINE_VISIBILITY |
| 6076 | int operator--(int) volatile |
| 6077 | {return fetch_sub(int(1));} |
| 6078 | _LIBCPP_INLINE_VISIBILITY |
| 6079 | int operator--(int) |
| 6080 | {return fetch_sub(int(1));} |
| 6081 | _LIBCPP_INLINE_VISIBILITY |
| 6082 | int operator++() volatile |
| 6083 | {return int(fetch_add(int(1)) + 1);} |
| 6084 | _LIBCPP_INLINE_VISIBILITY |
| 6085 | int operator++() |
| 6086 | {return int(fetch_add(int(1)) + 1);} |
| 6087 | _LIBCPP_INLINE_VISIBILITY |
| 6088 | int operator--() volatile |
| 6089 | {return int(fetch_sub(int(1)) - 1);} |
| 6090 | _LIBCPP_INLINE_VISIBILITY |
| 6091 | int operator--() |
| 6092 | {return int(fetch_sub(int(1)) - 1);} |
| 6093 | _LIBCPP_INLINE_VISIBILITY |
| 6094 | int operator+=(int __v) volatile |
| 6095 | {return int(fetch_add(__v) + __v);} |
| 6096 | _LIBCPP_INLINE_VISIBILITY |
| 6097 | int operator+=(int __v) |
| 6098 | {return int(fetch_add(__v) + __v);} |
| 6099 | _LIBCPP_INLINE_VISIBILITY |
| 6100 | int operator-=(int __v) volatile |
| 6101 | {return int(fetch_sub(__v) - __v);} |
| 6102 | _LIBCPP_INLINE_VISIBILITY |
| 6103 | int operator-=(int __v) |
| 6104 | {return int(fetch_sub(__v) - __v);} |
| 6105 | _LIBCPP_INLINE_VISIBILITY |
| 6106 | int operator&=(int __v) volatile |
| 6107 | {return int(fetch_and(__v) & __v);} |
| 6108 | _LIBCPP_INLINE_VISIBILITY |
| 6109 | int operator&=(int __v) |
| 6110 | {return int(fetch_and(__v) & __v);} |
| 6111 | _LIBCPP_INLINE_VISIBILITY |
| 6112 | int operator|=(int __v) volatile |
| 6113 | {return int(fetch_or(__v) | __v);} |
| 6114 | _LIBCPP_INLINE_VISIBILITY |
| 6115 | int operator|=(int __v) |
| 6116 | {return int(fetch_or(__v) | __v);} |
| 6117 | _LIBCPP_INLINE_VISIBILITY |
| 6118 | int operator^=(int __v) volatile |
| 6119 | {return int(fetch_xor(__v) ^ __v);} |
| 6120 | _LIBCPP_INLINE_VISIBILITY |
| 6121 | int operator^=(int __v) |
| 6122 | {return int(fetch_xor(__v) ^ __v);} |
| 6123 | } atomic_int; |
| 6124 | |
| 6125 | inline _LIBCPP_INLINE_VISIBILITY |
| 6126 | bool |
| 6127 | atomic_is_lock_free(const volatile atomic_int*) |
| 6128 | { |
| 6129 | typedef int type; |
| 6130 | return __atomic_is_lock_free(type); |
| 6131 | } |
| 6132 | |
| 6133 | inline _LIBCPP_INLINE_VISIBILITY |
| 6134 | bool |
| 6135 | atomic_is_lock_free(const atomic_int* __obj) |
| 6136 | { |
| 6137 | return atomic_is_lock_free(const_cast<volatile atomic_int*>(__obj)); |
| 6138 | } |
| 6139 | |
| 6140 | inline _LIBCPP_INLINE_VISIBILITY |
| 6141 | void |
| 6142 | atomic_init(volatile atomic_int* __obj, int __desr) |
| 6143 | { |
| 6144 | __obj->__v_ = __desr; |
| 6145 | } |
| 6146 | |
| 6147 | inline _LIBCPP_INLINE_VISIBILITY |
| 6148 | void |
| 6149 | atomic_init(atomic_int* __obj, int __desr) |
| 6150 | { |
| 6151 | __obj->__v_ = __desr; |
| 6152 | } |
| 6153 | |
| 6154 | inline _LIBCPP_INLINE_VISIBILITY |
| 6155 | void |
| 6156 | atomic_store(volatile atomic_int* __obj, int __desr) |
| 6157 | { |
| 6158 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 6159 | } |
| 6160 | |
| 6161 | inline _LIBCPP_INLINE_VISIBILITY |
| 6162 | void |
| 6163 | atomic_store(atomic_int* __obj, int __desr) |
| 6164 | { |
| 6165 | atomic_store(const_cast<volatile atomic_int*>(__obj), __desr); |
| 6166 | } |
| 6167 | |
| 6168 | inline _LIBCPP_INLINE_VISIBILITY |
| 6169 | void |
| 6170 | atomic_store_explicit(volatile atomic_int* __obj, int __desr, |
| 6171 | memory_order __o) |
| 6172 | { |
| 6173 | __atomic_store(&__obj->__v_, __desr, __o); |
| 6174 | } |
| 6175 | |
| 6176 | inline _LIBCPP_INLINE_VISIBILITY |
| 6177 | void |
| 6178 | atomic_store_explicit(atomic_int* __obj, int __desr, memory_order __o) |
| 6179 | { |
| 6180 | atomic_store_explicit(const_cast<volatile atomic_int*>(__obj), __desr, |
| 6181 | __o); |
| 6182 | } |
| 6183 | |
| 6184 | inline _LIBCPP_INLINE_VISIBILITY |
| 6185 | int |
| 6186 | atomic_load(const volatile atomic_int* __obj) |
| 6187 | { |
| 6188 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 6189 | } |
| 6190 | |
| 6191 | inline _LIBCPP_INLINE_VISIBILITY |
| 6192 | int |
| 6193 | atomic_load(const atomic_int* __obj) |
| 6194 | { |
| 6195 | return atomic_load(const_cast<const volatile atomic_int*>(__obj)); |
| 6196 | } |
| 6197 | |
| 6198 | inline _LIBCPP_INLINE_VISIBILITY |
| 6199 | int |
| 6200 | atomic_load_explicit(const volatile atomic_int* __obj, memory_order __o) |
| 6201 | { |
| 6202 | return __atomic_load(&__obj->__v_, __o); |
| 6203 | } |
| 6204 | |
| 6205 | inline _LIBCPP_INLINE_VISIBILITY |
| 6206 | int |
| 6207 | atomic_load_explicit(const atomic_int* __obj, memory_order __o) |
| 6208 | { |
| 6209 | return atomic_load_explicit(const_cast<const volatile atomic_int*> |
| 6210 | (__obj), __o); |
| 6211 | } |
| 6212 | |
| 6213 | inline _LIBCPP_INLINE_VISIBILITY |
| 6214 | int |
| 6215 | atomic_exchange(volatile atomic_int* __obj, int __desr) |
| 6216 | { |
| 6217 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 6218 | } |
| 6219 | |
| 6220 | inline _LIBCPP_INLINE_VISIBILITY |
| 6221 | int |
| 6222 | atomic_exchange(atomic_int* __obj, int __desr) |
| 6223 | { |
| 6224 | return atomic_exchange(const_cast<volatile atomic_int*>(__obj), __desr); |
| 6225 | } |
| 6226 | |
| 6227 | inline _LIBCPP_INLINE_VISIBILITY |
| 6228 | int |
| 6229 | atomic_exchange_explicit(volatile atomic_int* __obj, int __desr, |
| 6230 | memory_order __o) |
| 6231 | { |
| 6232 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 6233 | } |
| 6234 | |
| 6235 | inline _LIBCPP_INLINE_VISIBILITY |
| 6236 | int |
| 6237 | atomic_exchange_explicit(atomic_int* __obj, int __desr, memory_order __o) |
| 6238 | { |
| 6239 | return atomic_exchange_explicit(const_cast<volatile atomic_int*> |
| 6240 | (__obj), __desr, __o); |
| 6241 | } |
| 6242 | |
| 6243 | inline _LIBCPP_INLINE_VISIBILITY |
| 6244 | bool |
| 6245 | atomic_compare_exchange_weak(volatile atomic_int* __obj, int* __exp, |
| 6246 | int __desr) |
| 6247 | { |
| 6248 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 6249 | memory_order_seq_cst, memory_order_seq_cst); |
| 6250 | } |
| 6251 | |
| 6252 | inline _LIBCPP_INLINE_VISIBILITY |
| 6253 | bool |
| 6254 | atomic_compare_exchange_weak(atomic_int* __obj, int* __exp, int __desr) |
| 6255 | { |
| 6256 | return atomic_compare_exchange_weak(const_cast<volatile atomic_int*> |
| 6257 | (__obj), __exp, __desr); |
| 6258 | } |
| 6259 | |
| 6260 | inline _LIBCPP_INLINE_VISIBILITY |
| 6261 | bool |
| 6262 | atomic_compare_exchange_strong(volatile atomic_int* __obj, int* __exp, |
| 6263 | int __desr) |
| 6264 | { |
| 6265 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 6266 | memory_order_seq_cst, memory_order_seq_cst); |
| 6267 | } |
| 6268 | |
| 6269 | inline _LIBCPP_INLINE_VISIBILITY |
| 6270 | bool |
| 6271 | atomic_compare_exchange_strong(atomic_int* __obj, int* __exp, int __desr) |
| 6272 | { |
| 6273 | return atomic_compare_exchange_strong(const_cast<volatile atomic_int*> |
| 6274 | (__obj), __exp, __desr); |
| 6275 | } |
| 6276 | |
| 6277 | inline _LIBCPP_INLINE_VISIBILITY |
| 6278 | bool |
| 6279 | atomic_compare_exchange_weak_explicit(volatile atomic_int* __obj, int* __exp, |
| 6280 | int __desr, memory_order __s, |
| 6281 | memory_order __f) |
| 6282 | { |
| 6283 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 6284 | __f); |
| 6285 | } |
| 6286 | |
| 6287 | inline _LIBCPP_INLINE_VISIBILITY |
| 6288 | bool |
| 6289 | atomic_compare_exchange_weak_explicit(atomic_int* __obj, int* __exp, |
| 6290 | int __desr, memory_order __s, |
| 6291 | memory_order __f) |
| 6292 | { |
| 6293 | return atomic_compare_exchange_weak_explicit( |
| 6294 | const_cast<volatile atomic_int*>(__obj), __exp, __desr, __s, __f); |
| 6295 | } |
| 6296 | |
| 6297 | inline _LIBCPP_INLINE_VISIBILITY |
| 6298 | bool |
| 6299 | atomic_compare_exchange_strong_explicit(volatile atomic_int* __obj, |
| 6300 | int* __exp, int __desr, |
| 6301 | memory_order __s, memory_order __f) |
| 6302 | { |
| 6303 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 6304 | __f); |
| 6305 | } |
| 6306 | |
| 6307 | inline _LIBCPP_INLINE_VISIBILITY |
| 6308 | bool |
| 6309 | atomic_compare_exchange_strong_explicit(atomic_int* __obj, int* __exp, |
| 6310 | int __desr, memory_order __s, |
| 6311 | memory_order __f) |
| 6312 | { |
| 6313 | return atomic_compare_exchange_strong_explicit( |
| 6314 | const_cast<volatile atomic_int*>(__obj), __exp, __desr, __s, __f); |
| 6315 | } |
| 6316 | |
| 6317 | inline _LIBCPP_INLINE_VISIBILITY |
| 6318 | int |
| 6319 | atomic_fetch_add(volatile atomic_int* __obj, int __v) |
| 6320 | { |
| 6321 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 6322 | } |
| 6323 | |
| 6324 | inline _LIBCPP_INLINE_VISIBILITY |
| 6325 | int |
| 6326 | atomic_fetch_add(atomic_int* __obj, int __v) |
| 6327 | { |
| 6328 | return atomic_fetch_add(const_cast<volatile atomic_int*>(__obj), __v); |
| 6329 | } |
| 6330 | |
| 6331 | inline _LIBCPP_INLINE_VISIBILITY |
| 6332 | int |
| 6333 | atomic_fetch_add_explicit(volatile atomic_int* __obj, int __v, |
| 6334 | memory_order __o) |
| 6335 | { |
| 6336 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 6337 | } |
| 6338 | |
| 6339 | inline _LIBCPP_INLINE_VISIBILITY |
| 6340 | int |
| 6341 | atomic_fetch_add_explicit(atomic_int* __obj, int __v, memory_order __o) |
| 6342 | { |
| 6343 | return atomic_fetch_add_explicit(const_cast<volatile atomic_int*>(__obj), |
| 6344 | __v, __o); |
| 6345 | } |
| 6346 | |
| 6347 | inline _LIBCPP_INLINE_VISIBILITY |
| 6348 | int |
| 6349 | atomic_fetch_sub(volatile atomic_int* __obj, int __v) |
| 6350 | { |
| 6351 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 6352 | } |
| 6353 | |
| 6354 | inline _LIBCPP_INLINE_VISIBILITY |
| 6355 | int |
| 6356 | atomic_fetch_sub(atomic_int* __obj, int __v) |
| 6357 | { |
| 6358 | return atomic_fetch_sub(const_cast<volatile atomic_int*>(__obj), __v); |
| 6359 | } |
| 6360 | |
| 6361 | inline _LIBCPP_INLINE_VISIBILITY |
| 6362 | int |
| 6363 | atomic_fetch_sub_explicit(volatile atomic_int* __obj, int __v, |
| 6364 | memory_order __o) |
| 6365 | { |
| 6366 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 6367 | } |
| 6368 | |
| 6369 | inline _LIBCPP_INLINE_VISIBILITY |
| 6370 | int |
| 6371 | atomic_fetch_sub_explicit(atomic_int* __obj, int __v, memory_order __o) |
| 6372 | { |
| 6373 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_int*>(__obj), |
| 6374 | __v, __o); |
| 6375 | } |
| 6376 | |
| 6377 | inline _LIBCPP_INLINE_VISIBILITY |
| 6378 | int |
| 6379 | atomic_fetch_and(volatile atomic_int* __obj, int __v) |
| 6380 | { |
| 6381 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 6382 | } |
| 6383 | |
| 6384 | inline _LIBCPP_INLINE_VISIBILITY |
| 6385 | int |
| 6386 | atomic_fetch_and(atomic_int* __obj, int __v) |
| 6387 | { |
| 6388 | return atomic_fetch_and(const_cast<volatile atomic_int*>(__obj), __v); |
| 6389 | } |
| 6390 | |
| 6391 | inline _LIBCPP_INLINE_VISIBILITY |
| 6392 | int |
| 6393 | atomic_fetch_and_explicit(volatile atomic_int* __obj, int __v, |
| 6394 | memory_order __o) |
| 6395 | { |
| 6396 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 6397 | } |
| 6398 | |
| 6399 | inline _LIBCPP_INLINE_VISIBILITY |
| 6400 | int |
| 6401 | atomic_fetch_and_explicit(atomic_int* __obj, int __v, memory_order __o) |
| 6402 | { |
| 6403 | return atomic_fetch_and_explicit(const_cast<volatile atomic_int*>(__obj), |
| 6404 | __v, __o); |
| 6405 | } |
| 6406 | |
| 6407 | inline _LIBCPP_INLINE_VISIBILITY |
| 6408 | int |
| 6409 | atomic_fetch_or(volatile atomic_int* __obj, int __v) |
| 6410 | { |
| 6411 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 6412 | } |
| 6413 | |
| 6414 | inline _LIBCPP_INLINE_VISIBILITY |
| 6415 | int |
| 6416 | atomic_fetch_or(atomic_int* __obj, int __v) |
| 6417 | { |
| 6418 | return atomic_fetch_or(const_cast<volatile atomic_int*>(__obj), __v); |
| 6419 | } |
| 6420 | |
| 6421 | inline _LIBCPP_INLINE_VISIBILITY |
| 6422 | int |
| 6423 | atomic_fetch_or_explicit(volatile atomic_int* __obj, int __v, |
| 6424 | memory_order __o) |
| 6425 | { |
| 6426 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 6427 | } |
| 6428 | |
| 6429 | inline _LIBCPP_INLINE_VISIBILITY |
| 6430 | int |
| 6431 | atomic_fetch_or_explicit(atomic_int* __obj, int __v, memory_order __o) |
| 6432 | { |
| 6433 | return atomic_fetch_or_explicit(const_cast<volatile atomic_int*>(__obj), |
| 6434 | __v, __o); |
| 6435 | } |
| 6436 | |
| 6437 | inline _LIBCPP_INLINE_VISIBILITY |
| 6438 | int |
| 6439 | atomic_fetch_xor(volatile atomic_int* __obj, int __v) |
| 6440 | { |
| 6441 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 6442 | } |
| 6443 | |
| 6444 | inline _LIBCPP_INLINE_VISIBILITY |
| 6445 | int |
| 6446 | atomic_fetch_xor(atomic_int* __obj, int __v) |
| 6447 | { |
| 6448 | return atomic_fetch_xor(const_cast<volatile atomic_int*>(__obj), __v); |
| 6449 | } |
| 6450 | |
| 6451 | inline _LIBCPP_INLINE_VISIBILITY |
| 6452 | int |
| 6453 | atomic_fetch_xor_explicit(volatile atomic_int* __obj, int __v, |
| 6454 | memory_order __o) |
| 6455 | { |
| 6456 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 6457 | } |
| 6458 | |
| 6459 | inline _LIBCPP_INLINE_VISIBILITY |
| 6460 | int |
| 6461 | atomic_fetch_xor_explicit(atomic_int* __obj, int __v, memory_order __o) |
| 6462 | { |
| 6463 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_int*>(__obj), |
| 6464 | __v, __o); |
| 6465 | } |
| 6466 | |
| 6467 | // atomic_uint |
| 6468 | |
| 6469 | struct atomic_uint; |
| 6470 | |
| 6471 | bool atomic_is_lock_free(const volatile atomic_uint*); |
| 6472 | bool atomic_is_lock_free(const atomic_uint*); |
| 6473 | void atomic_init(volatile atomic_uint*, unsigned int); |
| 6474 | void atomic_init(atomic_uint*, unsigned int); |
| 6475 | void atomic_store(volatile atomic_uint*, unsigned int); |
| 6476 | void atomic_store(atomic_uint*, unsigned int); |
| 6477 | void atomic_store_explicit(volatile atomic_uint*, unsigned int, memory_order); |
| 6478 | void atomic_store_explicit(atomic_uint*, unsigned int, memory_order); |
| 6479 | unsigned int atomic_load(const volatile atomic_uint*); |
| 6480 | unsigned int atomic_load(const atomic_uint*); |
| 6481 | unsigned int atomic_load_explicit(const volatile atomic_uint*, memory_order); |
| 6482 | unsigned int atomic_load_explicit(const atomic_uint*, memory_order); |
| 6483 | unsigned int atomic_exchange(volatile atomic_uint*, unsigned int); |
| 6484 | unsigned int atomic_exchange(atomic_uint*, unsigned int); |
| 6485 | unsigned int atomic_exchange_explicit(volatile atomic_uint*, unsigned int, |
| 6486 | memory_order); |
| 6487 | unsigned int atomic_exchange_explicit(atomic_uint*, unsigned int, |
| 6488 | memory_order); |
| 6489 | bool atomic_compare_exchange_weak(volatile atomic_uint*, unsigned int*, |
| 6490 | unsigned int); |
| 6491 | bool atomic_compare_exchange_weak(atomic_uint*, unsigned int*, unsigned int); |
| 6492 | bool atomic_compare_exchange_strong(volatile atomic_uint*, unsigned int*, |
| 6493 | unsigned int); |
| 6494 | bool atomic_compare_exchange_strong(atomic_uint*, unsigned int*, |
| 6495 | unsigned int); |
| 6496 | bool atomic_compare_exchange_weak_explicit(volatile atomic_uint*, |
| 6497 | unsigned int*, unsigned int, |
| 6498 | memory_order, memory_order); |
| 6499 | bool atomic_compare_exchange_weak_explicit(atomic_uint*, unsigned int*, |
| 6500 | unsigned int, memory_order, |
| 6501 | memory_order); |
| 6502 | bool atomic_compare_exchange_strong_explicit(volatile atomic_uint*, |
| 6503 | unsigned int*, unsigned int, |
| 6504 | memory_order, memory_order); |
| 6505 | bool atomic_compare_exchange_strong_explicit(atomic_uint*, unsigned int*, |
| 6506 | unsigned int, memory_order, |
| 6507 | memory_order); |
| 6508 | unsigned int atomic_fetch_add(volatile atomic_uint*, unsigned int); |
| 6509 | unsigned int atomic_fetch_add(atomic_uint*, unsigned int); |
| 6510 | unsigned int atomic_fetch_add_explicit(volatile atomic_uint*, unsigned int, |
| 6511 | memory_order); |
| 6512 | unsigned int atomic_fetch_add_explicit(atomic_uint*, unsigned int, |
| 6513 | memory_order); |
| 6514 | unsigned int atomic_fetch_sub(volatile atomic_uint*, unsigned int); |
| 6515 | unsigned int atomic_fetch_sub(atomic_uint*, unsigned int); |
| 6516 | unsigned int atomic_fetch_sub_explicit(volatile atomic_uint*, unsigned int, |
| 6517 | memory_order); |
| 6518 | unsigned int atomic_fetch_sub_explicit(atomic_uint*, unsigned int, |
| 6519 | memory_order); |
| 6520 | unsigned int atomic_fetch_and(volatile atomic_uint*, unsigned int); |
| 6521 | unsigned int atomic_fetch_and(atomic_uint*, unsigned int); |
| 6522 | unsigned int atomic_fetch_and_explicit(volatile atomic_uint*, unsigned int, |
| 6523 | memory_order); |
| 6524 | unsigned int atomic_fetch_and_explicit(atomic_uint*, unsigned int, |
| 6525 | memory_order); |
| 6526 | unsigned int atomic_fetch_or(volatile atomic_uint*, unsigned int); |
| 6527 | unsigned int atomic_fetch_or(atomic_uint*, unsigned int); |
| 6528 | unsigned int atomic_fetch_or_explicit(volatile atomic_uint*, unsigned int, |
| 6529 | memory_order); |
| 6530 | unsigned int atomic_fetch_or_explicit(atomic_uint*, unsigned int, |
| 6531 | memory_order); |
| 6532 | unsigned int atomic_fetch_xor(volatile atomic_uint*, unsigned int); |
| 6533 | unsigned int atomic_fetch_xor(atomic_uint*, unsigned int); |
| 6534 | unsigned int atomic_fetch_xor_explicit(volatile atomic_uint*, unsigned int, |
| 6535 | memory_order); |
| 6536 | unsigned int atomic_fetch_xor_explicit(atomic_uint*, unsigned int, |
| 6537 | memory_order); |
| 6538 | |
| 6539 | typedef struct atomic_uint |
| 6540 | { |
| 6541 | unsigned int __v_; |
| 6542 | |
| 6543 | _LIBCPP_INLINE_VISIBILITY |
| 6544 | bool is_lock_free() const volatile |
| 6545 | {return atomic_is_lock_free(this);} |
| 6546 | _LIBCPP_INLINE_VISIBILITY |
| 6547 | bool is_lock_free() const |
| 6548 | {return atomic_is_lock_free(this);} |
| 6549 | _LIBCPP_INLINE_VISIBILITY |
| 6550 | void store(unsigned int __v, |
| 6551 | memory_order __o = memory_order_seq_cst) volatile |
| 6552 | {atomic_store_explicit(this, __v, __o);} |
| 6553 | _LIBCPP_INLINE_VISIBILITY |
| 6554 | void store(unsigned int __v, memory_order __o = memory_order_seq_cst) |
| 6555 | {atomic_store_explicit(this, __v, __o);} |
| 6556 | _LIBCPP_INLINE_VISIBILITY |
| 6557 | unsigned int load(memory_order __o = memory_order_seq_cst) const volatile |
| 6558 | {return atomic_load_explicit(this, __o);} |
| 6559 | _LIBCPP_INLINE_VISIBILITY |
| 6560 | unsigned int load(memory_order __o = memory_order_seq_cst) const |
| 6561 | {return atomic_load_explicit(this, __o);} |
| 6562 | _LIBCPP_INLINE_VISIBILITY |
| 6563 | operator unsigned int() const volatile |
| 6564 | {return load();} |
| 6565 | _LIBCPP_INLINE_VISIBILITY |
| 6566 | operator unsigned int() const |
| 6567 | {return load();} |
| 6568 | _LIBCPP_INLINE_VISIBILITY |
| 6569 | unsigned int exchange(unsigned int __v, |
| 6570 | memory_order __o = memory_order_seq_cst) volatile |
| 6571 | {return atomic_exchange_explicit(this, __v, __o);} |
| 6572 | _LIBCPP_INLINE_VISIBILITY |
| 6573 | unsigned int exchange(unsigned int __v, |
| 6574 | memory_order __o = memory_order_seq_cst) |
| 6575 | {return atomic_exchange_explicit(this, __v, __o);} |
| 6576 | _LIBCPP_INLINE_VISIBILITY |
| 6577 | bool compare_exchange_weak(unsigned int& __v, unsigned int __e, |
| 6578 | memory_order __s, memory_order __f) volatile |
| 6579 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 6580 | __f);} |
| 6581 | _LIBCPP_INLINE_VISIBILITY |
| 6582 | bool compare_exchange_weak(unsigned int& __v, unsigned int __e, |
| 6583 | memory_order __s, memory_order __f) |
| 6584 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 6585 | __f);} |
| 6586 | _LIBCPP_INLINE_VISIBILITY |
| 6587 | bool compare_exchange_strong(unsigned int& __v, unsigned int __e, |
| 6588 | memory_order __s, memory_order __f) volatile |
| 6589 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6590 | __f);} |
| 6591 | _LIBCPP_INLINE_VISIBILITY |
| 6592 | bool compare_exchange_strong(unsigned int& __v, unsigned int __e, |
| 6593 | memory_order __s, memory_order __f) |
| 6594 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6595 | __f);} |
| 6596 | _LIBCPP_INLINE_VISIBILITY |
| 6597 | bool compare_exchange_weak(unsigned int& __v, unsigned int __e, |
| 6598 | memory_order __s = memory_order_seq_cst) volatile |
| 6599 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 6600 | __translate_memory_order(__s));} |
| 6601 | _LIBCPP_INLINE_VISIBILITY |
| 6602 | bool compare_exchange_weak(unsigned int& __v, unsigned int __e, |
| 6603 | memory_order __s = memory_order_seq_cst) |
| 6604 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 6605 | __translate_memory_order(__s));} |
| 6606 | _LIBCPP_INLINE_VISIBILITY |
| 6607 | bool compare_exchange_strong(unsigned int& __v, unsigned int __e, |
| 6608 | memory_order __s = memory_order_seq_cst) volatile |
| 6609 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6610 | __translate_memory_order(__s));} |
| 6611 | _LIBCPP_INLINE_VISIBILITY |
| 6612 | bool compare_exchange_strong(unsigned int& __v, unsigned int __e, |
| 6613 | memory_order __s = memory_order_seq_cst) |
| 6614 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 6615 | __translate_memory_order(__s));} |
| 6616 | _LIBCPP_INLINE_VISIBILITY |
| 6617 | unsigned int fetch_add(unsigned int __v, |
| 6618 | memory_order __o = memory_order_seq_cst) volatile |
| 6619 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 6620 | _LIBCPP_INLINE_VISIBILITY |
| 6621 | unsigned int fetch_add(unsigned int __v, |
| 6622 | memory_order __o = memory_order_seq_cst) |
| 6623 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 6624 | _LIBCPP_INLINE_VISIBILITY |
| 6625 | unsigned int fetch_sub(unsigned int __v, |
| 6626 | memory_order __o = memory_order_seq_cst) volatile |
| 6627 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 6628 | _LIBCPP_INLINE_VISIBILITY |
| 6629 | unsigned int fetch_sub(unsigned int __v, |
| 6630 | memory_order __o = memory_order_seq_cst) |
| 6631 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 6632 | _LIBCPP_INLINE_VISIBILITY |
| 6633 | unsigned int fetch_and(unsigned int __v, |
| 6634 | memory_order __o = memory_order_seq_cst) volatile |
| 6635 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 6636 | _LIBCPP_INLINE_VISIBILITY |
| 6637 | unsigned int fetch_and(unsigned int __v, |
| 6638 | memory_order __o = memory_order_seq_cst) |
| 6639 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 6640 | _LIBCPP_INLINE_VISIBILITY |
| 6641 | unsigned int fetch_or(unsigned int __v, |
| 6642 | memory_order __o = memory_order_seq_cst) volatile |
| 6643 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 6644 | _LIBCPP_INLINE_VISIBILITY |
| 6645 | unsigned int fetch_or(unsigned int __v, |
| 6646 | memory_order __o = memory_order_seq_cst) |
| 6647 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 6648 | _LIBCPP_INLINE_VISIBILITY |
| 6649 | unsigned int fetch_xor(unsigned int __v, |
| 6650 | memory_order __o = memory_order_seq_cst) volatile |
| 6651 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 6652 | _LIBCPP_INLINE_VISIBILITY |
| 6653 | unsigned int fetch_xor(unsigned int __v, |
| 6654 | memory_order __o = memory_order_seq_cst) |
| 6655 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 6656 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 6657 | atomic_uint() = default; |
| 6658 | #else |
| 6659 | _LIBCPP_INLINE_VISIBILITY |
| 6660 | atomic_uint() {} |
| 6661 | #endif |
| 6662 | _LIBCPP_INLINE_VISIBILITY |
| 6663 | /*constexpr*/ atomic_uint(unsigned int __v) |
| 6664 | : __v_(__v) {} |
| 6665 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 6666 | atomic_uint(const atomic_uint&) = delete; |
| 6667 | atomic_uint& operator=(const atomic_uint&) = delete; |
| 6668 | atomic_uint& operator=(const atomic_uint&) volatile = delete; |
| 6669 | #else |
| 6670 | private: |
| 6671 | atomic_uint(const atomic_uint&); |
| 6672 | atomic_uint& operator=(const atomic_uint&); |
| 6673 | atomic_uint& operator=(const atomic_uint&) volatile; |
| 6674 | public: |
| 6675 | #endif |
| 6676 | _LIBCPP_INLINE_VISIBILITY |
| 6677 | unsigned int operator=(unsigned int __v) volatile |
| 6678 | {store(__v); return __v;} |
| 6679 | _LIBCPP_INLINE_VISIBILITY |
| 6680 | unsigned int operator=(unsigned int __v) |
| 6681 | {store(__v); return __v;} |
| 6682 | _LIBCPP_INLINE_VISIBILITY |
| 6683 | unsigned int operator++(int) volatile |
| 6684 | {typedef unsigned int type; return fetch_add(type(1));} |
| 6685 | _LIBCPP_INLINE_VISIBILITY |
| 6686 | int operator++(int) |
| 6687 | {typedef unsigned int type; return fetch_add(type(1));} |
| 6688 | _LIBCPP_INLINE_VISIBILITY |
| 6689 | int operator--(int) volatile |
| 6690 | {typedef unsigned int type; return fetch_sub(type(1));} |
| 6691 | _LIBCPP_INLINE_VISIBILITY |
| 6692 | int operator--(int) |
| 6693 | {typedef unsigned int type; return fetch_sub(type(1));} |
| 6694 | _LIBCPP_INLINE_VISIBILITY |
| 6695 | int operator++() volatile |
| 6696 | {typedef unsigned int type; return type(fetch_add(type(1)) + 1);} |
| 6697 | _LIBCPP_INLINE_VISIBILITY |
| 6698 | int operator++() |
| 6699 | {typedef unsigned int type; return type(fetch_add(type(1)) + 1);} |
| 6700 | _LIBCPP_INLINE_VISIBILITY |
| 6701 | int operator--() volatile |
| 6702 | {typedef unsigned int type; return type(fetch_sub(type(1)) - 1);} |
| 6703 | _LIBCPP_INLINE_VISIBILITY |
| 6704 | int operator--() |
| 6705 | {typedef unsigned int type; return type(fetch_sub(type(1)) - 1);} |
| 6706 | _LIBCPP_INLINE_VISIBILITY |
| 6707 | int operator+=(int __v) volatile |
| 6708 | {typedef unsigned int type; return type(fetch_add(__v) + __v);} |
| 6709 | _LIBCPP_INLINE_VISIBILITY |
| 6710 | int operator+=(int __v) |
| 6711 | {typedef unsigned int type; return type(fetch_add(__v) + __v);} |
| 6712 | _LIBCPP_INLINE_VISIBILITY |
| 6713 | int operator-=(int __v) volatile |
| 6714 | {typedef unsigned int type; return type(fetch_sub(__v) - __v);} |
| 6715 | _LIBCPP_INLINE_VISIBILITY |
| 6716 | int operator-=(int __v) |
| 6717 | {typedef unsigned int type; return type(fetch_sub(__v) - __v);} |
| 6718 | _LIBCPP_INLINE_VISIBILITY |
| 6719 | int operator&=(int __v) volatile |
| 6720 | {typedef unsigned int type; return type(fetch_and(__v) & __v);} |
| 6721 | _LIBCPP_INLINE_VISIBILITY |
| 6722 | int operator&=(int __v) |
| 6723 | {typedef unsigned int type; return type(fetch_and(__v) & __v);} |
| 6724 | _LIBCPP_INLINE_VISIBILITY |
| 6725 | int operator|=(int __v) volatile |
| 6726 | {typedef unsigned int type; return type(fetch_or(__v) | __v);} |
| 6727 | _LIBCPP_INLINE_VISIBILITY |
| 6728 | int operator|=(int __v) |
| 6729 | {typedef unsigned int type; return type(fetch_or(__v) | __v);} |
| 6730 | _LIBCPP_INLINE_VISIBILITY |
| 6731 | int operator^=(int __v) volatile |
| 6732 | {typedef unsigned int type; return type(fetch_xor(__v) ^ __v);} |
| 6733 | _LIBCPP_INLINE_VISIBILITY |
| 6734 | int operator^=(int __v) |
| 6735 | {typedef unsigned int type; return type(fetch_xor(__v) ^ __v);} |
| 6736 | } atomic_uint; |
| 6737 | |
| 6738 | inline _LIBCPP_INLINE_VISIBILITY |
| 6739 | bool |
| 6740 | atomic_is_lock_free(const volatile atomic_uint*) |
| 6741 | { |
| 6742 | typedef unsigned int type; |
| 6743 | return __atomic_is_lock_free(type); |
| 6744 | } |
| 6745 | |
| 6746 | inline _LIBCPP_INLINE_VISIBILITY |
| 6747 | bool |
| 6748 | atomic_is_lock_free(const atomic_uint* __obj) |
| 6749 | { |
| 6750 | return atomic_is_lock_free(const_cast<volatile atomic_uint*>(__obj)); |
| 6751 | } |
| 6752 | |
| 6753 | inline _LIBCPP_INLINE_VISIBILITY |
| 6754 | void |
| 6755 | atomic_init(volatile atomic_uint* __obj, unsigned int __desr) |
| 6756 | { |
| 6757 | __obj->__v_ = __desr; |
| 6758 | } |
| 6759 | |
| 6760 | inline _LIBCPP_INLINE_VISIBILITY |
| 6761 | void |
| 6762 | atomic_init(atomic_uint* __obj, unsigned int __desr) |
| 6763 | { |
| 6764 | __obj->__v_ = __desr; |
| 6765 | } |
| 6766 | |
| 6767 | inline _LIBCPP_INLINE_VISIBILITY |
| 6768 | void |
| 6769 | atomic_store(volatile atomic_uint* __obj, unsigned int __desr) |
| 6770 | { |
| 6771 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 6772 | } |
| 6773 | |
| 6774 | inline _LIBCPP_INLINE_VISIBILITY |
| 6775 | void |
| 6776 | atomic_store(atomic_uint* __obj, unsigned int __desr) |
| 6777 | { |
| 6778 | atomic_store(const_cast<volatile atomic_uint*>(__obj), __desr); |
| 6779 | } |
| 6780 | |
| 6781 | inline _LIBCPP_INLINE_VISIBILITY |
| 6782 | void |
| 6783 | atomic_store_explicit(volatile atomic_uint* __obj, unsigned int __desr, |
| 6784 | memory_order __o) |
| 6785 | { |
| 6786 | __atomic_store(&__obj->__v_, __desr, __o); |
| 6787 | } |
| 6788 | |
| 6789 | inline _LIBCPP_INLINE_VISIBILITY |
| 6790 | void |
| 6791 | atomic_store_explicit(atomic_uint* __obj, unsigned int __desr, |
| 6792 | memory_order __o) |
| 6793 | { |
| 6794 | atomic_store_explicit(const_cast<volatile atomic_uint*>(__obj), __desr, |
| 6795 | __o); |
| 6796 | } |
| 6797 | |
| 6798 | inline _LIBCPP_INLINE_VISIBILITY |
| 6799 | unsigned int |
| 6800 | atomic_load(const volatile atomic_uint* __obj) |
| 6801 | { |
| 6802 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 6803 | } |
| 6804 | |
| 6805 | inline _LIBCPP_INLINE_VISIBILITY |
| 6806 | unsigned int |
| 6807 | atomic_load(const atomic_uint* __obj) |
| 6808 | { |
| 6809 | return atomic_load(const_cast<const volatile atomic_uint*>(__obj)); |
| 6810 | } |
| 6811 | |
| 6812 | inline _LIBCPP_INLINE_VISIBILITY |
| 6813 | unsigned int |
| 6814 | atomic_load_explicit(const volatile atomic_uint* __obj, memory_order __o) |
| 6815 | { |
| 6816 | return __atomic_load(&__obj->__v_, __o); |
| 6817 | } |
| 6818 | |
| 6819 | inline _LIBCPP_INLINE_VISIBILITY |
| 6820 | unsigned int |
| 6821 | atomic_load_explicit(const atomic_uint* __obj, memory_order __o) |
| 6822 | { |
| 6823 | return atomic_load_explicit(const_cast<const volatile atomic_uint*> |
| 6824 | (__obj), __o); |
| 6825 | } |
| 6826 | |
| 6827 | inline _LIBCPP_INLINE_VISIBILITY |
| 6828 | unsigned int |
| 6829 | atomic_exchange(volatile atomic_uint* __obj, unsigned int __desr) |
| 6830 | { |
| 6831 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 6832 | } |
| 6833 | |
| 6834 | inline _LIBCPP_INLINE_VISIBILITY |
| 6835 | unsigned int |
| 6836 | atomic_exchange(atomic_uint* __obj, unsigned int __desr) |
| 6837 | { |
| 6838 | return atomic_exchange(const_cast<volatile atomic_uint*>(__obj), __desr); |
| 6839 | } |
| 6840 | |
| 6841 | inline _LIBCPP_INLINE_VISIBILITY |
| 6842 | unsigned int |
| 6843 | atomic_exchange_explicit(volatile atomic_uint* __obj, unsigned int __desr, |
| 6844 | memory_order __o) |
| 6845 | { |
| 6846 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 6847 | } |
| 6848 | |
| 6849 | inline _LIBCPP_INLINE_VISIBILITY |
| 6850 | unsigned int |
| 6851 | atomic_exchange_explicit(atomic_uint* __obj, unsigned int __desr, |
| 6852 | memory_order __o) |
| 6853 | { |
| 6854 | return atomic_exchange_explicit(const_cast<volatile atomic_uint*> |
| 6855 | (__obj), __desr, __o); |
| 6856 | } |
| 6857 | |
| 6858 | inline _LIBCPP_INLINE_VISIBILITY |
| 6859 | bool |
| 6860 | atomic_compare_exchange_weak(volatile atomic_uint* __obj, unsigned int* __exp, |
| 6861 | unsigned int __desr) |
| 6862 | { |
| 6863 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 6864 | memory_order_seq_cst, memory_order_seq_cst); |
| 6865 | } |
| 6866 | |
| 6867 | inline _LIBCPP_INLINE_VISIBILITY |
| 6868 | bool |
| 6869 | atomic_compare_exchange_weak(atomic_uint* __obj, unsigned int* __exp, |
| 6870 | unsigned int __desr) |
| 6871 | { |
| 6872 | return atomic_compare_exchange_weak(const_cast<volatile atomic_uint*> |
| 6873 | (__obj), __exp, __desr); |
| 6874 | } |
| 6875 | |
| 6876 | inline _LIBCPP_INLINE_VISIBILITY |
| 6877 | bool |
| 6878 | atomic_compare_exchange_strong(volatile atomic_uint* __obj, |
| 6879 | unsigned int* __exp, unsigned int __desr) |
| 6880 | { |
| 6881 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 6882 | memory_order_seq_cst, memory_order_seq_cst); |
| 6883 | } |
| 6884 | |
| 6885 | inline _LIBCPP_INLINE_VISIBILITY |
| 6886 | bool |
| 6887 | atomic_compare_exchange_strong(atomic_uint* __obj, unsigned int* __exp, |
| 6888 | unsigned int __desr) |
| 6889 | { |
| 6890 | return atomic_compare_exchange_strong(const_cast<volatile atomic_uint*> |
| 6891 | (__obj), __exp, __desr); |
| 6892 | } |
| 6893 | |
| 6894 | inline _LIBCPP_INLINE_VISIBILITY |
| 6895 | bool |
| 6896 | atomic_compare_exchange_weak_explicit(volatile atomic_uint* __obj, |
| 6897 | unsigned int* __exp, |
| 6898 | unsigned int __desr, memory_order __s, |
| 6899 | memory_order __f) |
| 6900 | { |
| 6901 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 6902 | __f); |
| 6903 | } |
| 6904 | |
| 6905 | inline _LIBCPP_INLINE_VISIBILITY |
| 6906 | bool |
| 6907 | atomic_compare_exchange_weak_explicit(atomic_uint* __obj, unsigned int* __exp, |
| 6908 | unsigned int __desr, memory_order __s, |
| 6909 | memory_order __f) |
| 6910 | { |
| 6911 | return atomic_compare_exchange_weak_explicit( |
| 6912 | const_cast<volatile atomic_uint*>(__obj), __exp, __desr, __s, __f); |
| 6913 | } |
| 6914 | |
| 6915 | inline _LIBCPP_INLINE_VISIBILITY |
| 6916 | bool |
| 6917 | atomic_compare_exchange_strong_explicit(volatile atomic_uint* __obj, |
| 6918 | unsigned int* __exp, |
| 6919 | unsigned int __desr, memory_order __s, |
| 6920 | memory_order __f) |
| 6921 | { |
| 6922 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 6923 | __f); |
| 6924 | } |
| 6925 | |
| 6926 | inline _LIBCPP_INLINE_VISIBILITY |
| 6927 | bool |
| 6928 | atomic_compare_exchange_strong_explicit(atomic_uint* __obj, |
| 6929 | unsigned int* __exp, |
| 6930 | unsigned int __desr, memory_order __s, |
| 6931 | memory_order __f) |
| 6932 | { |
| 6933 | return atomic_compare_exchange_strong_explicit( |
| 6934 | const_cast<volatile atomic_uint*>(__obj), __exp, __desr, __s, __f); |
| 6935 | } |
| 6936 | |
| 6937 | inline _LIBCPP_INLINE_VISIBILITY |
| 6938 | unsigned int |
| 6939 | atomic_fetch_add(volatile atomic_uint* __obj, unsigned int __v) |
| 6940 | { |
| 6941 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 6942 | } |
| 6943 | |
| 6944 | inline _LIBCPP_INLINE_VISIBILITY |
| 6945 | unsigned int |
| 6946 | atomic_fetch_add(atomic_uint* __obj, unsigned int __v) |
| 6947 | { |
| 6948 | return atomic_fetch_add(const_cast<volatile atomic_uint*>(__obj), __v); |
| 6949 | } |
| 6950 | |
| 6951 | inline _LIBCPP_INLINE_VISIBILITY |
| 6952 | unsigned int |
| 6953 | atomic_fetch_add_explicit(volatile atomic_uint* __obj, unsigned int __v, |
| 6954 | memory_order __o) |
| 6955 | { |
| 6956 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 6957 | } |
| 6958 | |
| 6959 | inline _LIBCPP_INLINE_VISIBILITY |
| 6960 | unsigned int |
| 6961 | atomic_fetch_add_explicit(atomic_uint* __obj, unsigned int __v, |
| 6962 | memory_order __o) |
| 6963 | { |
| 6964 | return atomic_fetch_add_explicit(const_cast<volatile atomic_uint*>(__obj), |
| 6965 | __v, __o); |
| 6966 | } |
| 6967 | |
| 6968 | inline _LIBCPP_INLINE_VISIBILITY |
| 6969 | unsigned int |
| 6970 | atomic_fetch_sub(volatile atomic_uint* __obj, unsigned int __v) |
| 6971 | { |
| 6972 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 6973 | } |
| 6974 | |
| 6975 | inline _LIBCPP_INLINE_VISIBILITY |
| 6976 | unsigned int |
| 6977 | atomic_fetch_sub(atomic_uint* __obj, unsigned int __v) |
| 6978 | { |
| 6979 | return atomic_fetch_sub(const_cast<volatile atomic_uint*>(__obj), __v); |
| 6980 | } |
| 6981 | |
| 6982 | inline _LIBCPP_INLINE_VISIBILITY |
| 6983 | unsigned int |
| 6984 | atomic_fetch_sub_explicit(volatile atomic_uint* __obj, unsigned int __v, |
| 6985 | memory_order __o) |
| 6986 | { |
| 6987 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 6988 | } |
| 6989 | |
| 6990 | inline _LIBCPP_INLINE_VISIBILITY |
| 6991 | unsigned int |
| 6992 | atomic_fetch_sub_explicit(atomic_uint* __obj, unsigned int __v, |
| 6993 | memory_order __o) |
| 6994 | { |
| 6995 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_uint*>(__obj), |
| 6996 | __v, __o); |
| 6997 | } |
| 6998 | |
| 6999 | inline _LIBCPP_INLINE_VISIBILITY |
| 7000 | unsigned int |
| 7001 | atomic_fetch_and(volatile atomic_uint* __obj, unsigned int __v) |
| 7002 | { |
| 7003 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 7004 | } |
| 7005 | |
| 7006 | inline _LIBCPP_INLINE_VISIBILITY |
| 7007 | unsigned int |
| 7008 | atomic_fetch_and(atomic_uint* __obj, unsigned int __v) |
| 7009 | { |
| 7010 | return atomic_fetch_and(const_cast<volatile atomic_uint*>(__obj), __v); |
| 7011 | } |
| 7012 | |
| 7013 | inline _LIBCPP_INLINE_VISIBILITY |
| 7014 | unsigned int |
| 7015 | atomic_fetch_and_explicit(volatile atomic_uint* __obj, unsigned int __v, |
| 7016 | memory_order __o) |
| 7017 | { |
| 7018 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 7019 | } |
| 7020 | |
| 7021 | inline _LIBCPP_INLINE_VISIBILITY |
| 7022 | unsigned int |
| 7023 | atomic_fetch_and_explicit(atomic_uint* __obj, unsigned int __v, |
| 7024 | memory_order __o) |
| 7025 | { |
| 7026 | return atomic_fetch_and_explicit(const_cast<volatile atomic_uint*>(__obj), |
| 7027 | __v, __o); |
| 7028 | } |
| 7029 | |
| 7030 | inline _LIBCPP_INLINE_VISIBILITY |
| 7031 | unsigned int |
| 7032 | atomic_fetch_or(volatile atomic_uint* __obj, unsigned int __v) |
| 7033 | { |
| 7034 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 7035 | } |
| 7036 | |
| 7037 | inline _LIBCPP_INLINE_VISIBILITY |
| 7038 | unsigned int |
| 7039 | atomic_fetch_or(atomic_uint* __obj, unsigned int __v) |
| 7040 | { |
| 7041 | return atomic_fetch_or(const_cast<volatile atomic_uint*>(__obj), __v); |
| 7042 | } |
| 7043 | |
| 7044 | inline _LIBCPP_INLINE_VISIBILITY |
| 7045 | unsigned int |
| 7046 | atomic_fetch_or_explicit(volatile atomic_uint* __obj, unsigned int __v, |
| 7047 | memory_order __o) |
| 7048 | { |
| 7049 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 7050 | } |
| 7051 | |
| 7052 | inline _LIBCPP_INLINE_VISIBILITY |
| 7053 | unsigned int |
| 7054 | atomic_fetch_or_explicit(atomic_uint* __obj, unsigned int __v, |
| 7055 | memory_order __o) |
| 7056 | { |
| 7057 | return atomic_fetch_or_explicit(const_cast<volatile atomic_uint*>(__obj), |
| 7058 | __v, __o); |
| 7059 | } |
| 7060 | |
| 7061 | inline _LIBCPP_INLINE_VISIBILITY |
| 7062 | unsigned int |
| 7063 | atomic_fetch_xor(volatile atomic_uint* __obj, unsigned int __v) |
| 7064 | { |
| 7065 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 7066 | } |
| 7067 | |
| 7068 | inline _LIBCPP_INLINE_VISIBILITY |
| 7069 | unsigned int |
| 7070 | atomic_fetch_xor(atomic_uint* __obj, unsigned int __v) |
| 7071 | { |
| 7072 | return atomic_fetch_xor(const_cast<volatile atomic_uint*>(__obj), __v); |
| 7073 | } |
| 7074 | |
| 7075 | inline _LIBCPP_INLINE_VISIBILITY |
| 7076 | unsigned int |
| 7077 | atomic_fetch_xor_explicit(volatile atomic_uint* __obj, unsigned int __v, |
| 7078 | memory_order __o) |
| 7079 | { |
| 7080 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 7081 | } |
| 7082 | |
| 7083 | inline _LIBCPP_INLINE_VISIBILITY |
| 7084 | unsigned int |
| 7085 | atomic_fetch_xor_explicit(atomic_uint* __obj, unsigned int __v, |
| 7086 | memory_order __o) |
| 7087 | { |
| 7088 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_uint*>(__obj), |
| 7089 | __v, __o); |
| 7090 | } |
| 7091 | |
| 7092 | // atomic_long |
| 7093 | |
| 7094 | struct atomic_long; |
| 7095 | |
| 7096 | bool atomic_is_lock_free(const volatile atomic_long*); |
| 7097 | bool atomic_is_lock_free(const atomic_long*); |
| 7098 | void atomic_init(volatile atomic_long*, long); |
| 7099 | void atomic_init(atomic_long*, long); |
| 7100 | void atomic_store(volatile atomic_long*, long); |
| 7101 | void atomic_store(atomic_long*, long); |
| 7102 | void atomic_store_explicit(volatile atomic_long*, long, memory_order); |
| 7103 | void atomic_store_explicit(atomic_long*, long, memory_order); |
| 7104 | long atomic_load(const volatile atomic_long*); |
| 7105 | long atomic_load(const atomic_long*); |
| 7106 | long atomic_load_explicit(const volatile atomic_long*, memory_order); |
| 7107 | long atomic_load_explicit(const atomic_long*, memory_order); |
| 7108 | long atomic_exchange(volatile atomic_long*, long); |
| 7109 | long atomic_exchange(atomic_long*, long); |
| 7110 | long atomic_exchange_explicit(volatile atomic_long*, long, memory_order); |
| 7111 | long atomic_exchange_explicit(atomic_long*, long, memory_order); |
| 7112 | bool atomic_compare_exchange_weak(volatile atomic_long*, long*, long); |
| 7113 | bool atomic_compare_exchange_weak(atomic_long*, long*, long); |
| 7114 | bool atomic_compare_exchange_strong(volatile atomic_long*, long*, long); |
| 7115 | bool atomic_compare_exchange_strong(atomic_long*, long*, long); |
| 7116 | bool atomic_compare_exchange_weak_explicit(volatile atomic_long*, long*, long, |
| 7117 | memory_order, memory_order); |
| 7118 | bool atomic_compare_exchange_weak_explicit(atomic_long*, long*, long, |
| 7119 | memory_order, memory_order); |
| 7120 | bool atomic_compare_exchange_strong_explicit(volatile atomic_long*, long*, long, |
| 7121 | memory_order, memory_order); |
| 7122 | bool atomic_compare_exchange_strong_explicit(atomic_long*, long*, long, |
| 7123 | memory_order, memory_order); |
| 7124 | long atomic_fetch_add(volatile atomic_long*, long); |
| 7125 | long atomic_fetch_add(atomic_long*, long); |
| 7126 | long atomic_fetch_add_explicit(volatile atomic_long*, long, memory_order); |
| 7127 | long atomic_fetch_add_explicit(atomic_long*, long, memory_order); |
| 7128 | long atomic_fetch_sub(volatile atomic_long*, long); |
| 7129 | long atomic_fetch_sub(atomic_long*, long); |
| 7130 | long atomic_fetch_sub_explicit(volatile atomic_long*, long, memory_order); |
| 7131 | long atomic_fetch_sub_explicit(atomic_long*, long, memory_order); |
| 7132 | long atomic_fetch_and(volatile atomic_long*, long); |
| 7133 | long atomic_fetch_and(atomic_long*, long); |
| 7134 | long atomic_fetch_and_explicit(volatile atomic_long*, long, memory_order); |
| 7135 | long atomic_fetch_and_explicit(atomic_long*, long, memory_order); |
| 7136 | long atomic_fetch_or(volatile atomic_long*, long); |
| 7137 | long atomic_fetch_or(atomic_long*, long); |
| 7138 | long atomic_fetch_or_explicit(volatile atomic_long*, long, memory_order); |
| 7139 | long atomic_fetch_or_explicit(atomic_long*, long, memory_order); |
| 7140 | long atomic_fetch_xor(volatile atomic_long*, long); |
| 7141 | long atomic_fetch_xor(atomic_long*, long); |
| 7142 | long atomic_fetch_xor_explicit(volatile atomic_long*, long, memory_order); |
| 7143 | long atomic_fetch_xor_explicit(atomic_long*, long, memory_order); |
| 7144 | |
| 7145 | typedef struct atomic_long |
| 7146 | { |
| 7147 | long __v_; |
| 7148 | |
| 7149 | _LIBCPP_INLINE_VISIBILITY |
| 7150 | bool is_lock_free() const volatile |
| 7151 | {return atomic_is_lock_free(this);} |
| 7152 | _LIBCPP_INLINE_VISIBILITY |
| 7153 | bool is_lock_free() const |
| 7154 | {return atomic_is_lock_free(this);} |
| 7155 | _LIBCPP_INLINE_VISIBILITY |
| 7156 | void store(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7157 | {atomic_store_explicit(this, __v, __o);} |
| 7158 | _LIBCPP_INLINE_VISIBILITY |
| 7159 | void store(long __v, memory_order __o = memory_order_seq_cst) |
| 7160 | {atomic_store_explicit(this, __v, __o);} |
| 7161 | _LIBCPP_INLINE_VISIBILITY |
| 7162 | long load(memory_order __o = memory_order_seq_cst) const volatile |
| 7163 | {return atomic_load_explicit(this, __o);} |
| 7164 | _LIBCPP_INLINE_VISIBILITY |
| 7165 | long load(memory_order __o = memory_order_seq_cst) const |
| 7166 | {return atomic_load_explicit(this, __o);} |
| 7167 | _LIBCPP_INLINE_VISIBILITY |
| 7168 | operator long() const volatile |
| 7169 | {return load();} |
| 7170 | _LIBCPP_INLINE_VISIBILITY |
| 7171 | operator long() const |
| 7172 | {return load();} |
| 7173 | _LIBCPP_INLINE_VISIBILITY |
| 7174 | long exchange(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7175 | {return atomic_exchange_explicit(this, __v, __o);} |
| 7176 | _LIBCPP_INLINE_VISIBILITY |
| 7177 | long exchange(long __v, memory_order __o = memory_order_seq_cst) |
| 7178 | {return atomic_exchange_explicit(this, __v, __o);} |
| 7179 | _LIBCPP_INLINE_VISIBILITY |
| 7180 | bool compare_exchange_weak(long& __v, long __e, memory_order __s, |
| 7181 | memory_order __f) volatile |
| 7182 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7183 | __f);} |
| 7184 | _LIBCPP_INLINE_VISIBILITY |
| 7185 | bool compare_exchange_weak(long& __v, long __e, memory_order __s, |
| 7186 | memory_order __f) |
| 7187 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7188 | __f);} |
| 7189 | _LIBCPP_INLINE_VISIBILITY |
| 7190 | bool compare_exchange_strong(long& __v, long __e, memory_order __s, |
| 7191 | memory_order __f) volatile |
| 7192 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7193 | __f);} |
| 7194 | _LIBCPP_INLINE_VISIBILITY |
| 7195 | bool compare_exchange_strong(long& __v, long __e, memory_order __s, |
| 7196 | memory_order __f) |
| 7197 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7198 | __f);} |
| 7199 | _LIBCPP_INLINE_VISIBILITY |
| 7200 | bool compare_exchange_weak(long& __v, long __e, |
| 7201 | memory_order __s = memory_order_seq_cst) volatile |
| 7202 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7203 | __translate_memory_order(__s));} |
| 7204 | _LIBCPP_INLINE_VISIBILITY |
| 7205 | bool compare_exchange_weak(long& __v, long __e, |
| 7206 | memory_order __s = memory_order_seq_cst) |
| 7207 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7208 | __translate_memory_order(__s));} |
| 7209 | _LIBCPP_INLINE_VISIBILITY |
| 7210 | bool compare_exchange_strong(long& __v, long __e, |
| 7211 | memory_order __s = memory_order_seq_cst) volatile |
| 7212 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7213 | __translate_memory_order(__s));} |
| 7214 | _LIBCPP_INLINE_VISIBILITY |
| 7215 | bool compare_exchange_strong(long& __v, long __e, |
| 7216 | memory_order __s = memory_order_seq_cst) |
| 7217 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7218 | __translate_memory_order(__s));} |
| 7219 | _LIBCPP_INLINE_VISIBILITY |
| 7220 | long fetch_add(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7221 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 7222 | _LIBCPP_INLINE_VISIBILITY |
| 7223 | long fetch_add(long __v, memory_order __o = memory_order_seq_cst) |
| 7224 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 7225 | _LIBCPP_INLINE_VISIBILITY |
| 7226 | long fetch_sub(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7227 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 7228 | _LIBCPP_INLINE_VISIBILITY |
| 7229 | long fetch_sub(long __v, memory_order __o = memory_order_seq_cst) |
| 7230 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 7231 | _LIBCPP_INLINE_VISIBILITY |
| 7232 | long fetch_and(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7233 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 7234 | _LIBCPP_INLINE_VISIBILITY |
| 7235 | long fetch_and(long __v, memory_order __o = memory_order_seq_cst) |
| 7236 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 7237 | _LIBCPP_INLINE_VISIBILITY |
| 7238 | long fetch_or(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7239 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 7240 | _LIBCPP_INLINE_VISIBILITY |
| 7241 | long fetch_or(long __v, memory_order __o = memory_order_seq_cst) |
| 7242 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 7243 | _LIBCPP_INLINE_VISIBILITY |
| 7244 | long fetch_xor(long __v, memory_order __o = memory_order_seq_cst) volatile |
| 7245 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 7246 | _LIBCPP_INLINE_VISIBILITY |
| 7247 | long fetch_xor(long __v, memory_order __o = memory_order_seq_cst) |
| 7248 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 7249 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 7250 | atomic_long() = default; |
| 7251 | #else |
| 7252 | _LIBCPP_INLINE_VISIBILITY |
| 7253 | atomic_long() {} |
| 7254 | #endif |
| 7255 | _LIBCPP_INLINE_VISIBILITY |
| 7256 | /*constexpr*/ atomic_long(long __v) |
| 7257 | : __v_(__v) {} |
| 7258 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 7259 | atomic_long(const atomic_long&) = delete; |
| 7260 | atomic_long& operator=(const atomic_long&) = delete; |
| 7261 | atomic_long& operator=(const atomic_long&) volatile = delete; |
| 7262 | #else |
| 7263 | private: |
| 7264 | atomic_long(const atomic_long&); |
| 7265 | atomic_long& operator=(const atomic_long&); |
| 7266 | atomic_long& operator=(const atomic_long&) volatile; |
| 7267 | public: |
| 7268 | #endif |
| 7269 | _LIBCPP_INLINE_VISIBILITY |
| 7270 | long operator=(long __v) volatile |
| 7271 | {store(__v); return __v;} |
| 7272 | _LIBCPP_INLINE_VISIBILITY |
| 7273 | long operator=(long __v) |
| 7274 | {store(__v); return __v;} |
| 7275 | _LIBCPP_INLINE_VISIBILITY |
| 7276 | long operator++(int) volatile |
| 7277 | {return fetch_add(long(1));} |
| 7278 | _LIBCPP_INLINE_VISIBILITY |
| 7279 | long operator++(int) |
| 7280 | {return fetch_add(long(1));} |
| 7281 | _LIBCPP_INLINE_VISIBILITY |
| 7282 | long operator--(int) volatile |
| 7283 | {return fetch_sub(long(1));} |
| 7284 | _LIBCPP_INLINE_VISIBILITY |
| 7285 | long operator--(int) |
| 7286 | {return fetch_sub(long(1));} |
| 7287 | _LIBCPP_INLINE_VISIBILITY |
| 7288 | long operator++() volatile |
| 7289 | {return long(fetch_add(long(1)) + 1);} |
| 7290 | _LIBCPP_INLINE_VISIBILITY |
| 7291 | long operator++() |
| 7292 | {return long(fetch_add(long(1)) + 1);} |
| 7293 | _LIBCPP_INLINE_VISIBILITY |
| 7294 | long operator--() volatile |
| 7295 | {return long(fetch_sub(long(1)) - 1);} |
| 7296 | _LIBCPP_INLINE_VISIBILITY |
| 7297 | long operator--() |
| 7298 | {return long(fetch_sub(long(1)) - 1);} |
| 7299 | _LIBCPP_INLINE_VISIBILITY |
| 7300 | long operator+=(long __v) volatile |
| 7301 | {return long(fetch_add(__v) + __v);} |
| 7302 | _LIBCPP_INLINE_VISIBILITY |
| 7303 | long operator+=(long __v) |
| 7304 | {return long(fetch_add(__v) + __v);} |
| 7305 | _LIBCPP_INLINE_VISIBILITY |
| 7306 | long operator-=(long __v) volatile |
| 7307 | {return long(fetch_sub(__v) - __v);} |
| 7308 | _LIBCPP_INLINE_VISIBILITY |
| 7309 | long operator-=(long __v) |
| 7310 | {return long(fetch_sub(__v) - __v);} |
| 7311 | _LIBCPP_INLINE_VISIBILITY |
| 7312 | long operator&=(long __v) volatile |
| 7313 | {return long(fetch_and(__v) & __v);} |
| 7314 | _LIBCPP_INLINE_VISIBILITY |
| 7315 | long operator&=(long __v) |
| 7316 | {return long(fetch_and(__v) & __v);} |
| 7317 | _LIBCPP_INLINE_VISIBILITY |
| 7318 | long operator|=(long __v) volatile |
| 7319 | {return long(fetch_or(__v) | __v);} |
| 7320 | _LIBCPP_INLINE_VISIBILITY |
| 7321 | long operator|=(long __v) |
| 7322 | {return long(fetch_or(__v) | __v);} |
| 7323 | _LIBCPP_INLINE_VISIBILITY |
| 7324 | long operator^=(long __v) volatile |
| 7325 | {return long(fetch_xor(__v) ^ __v);} |
| 7326 | _LIBCPP_INLINE_VISIBILITY |
| 7327 | long operator^=(long __v) |
| 7328 | {return long(fetch_xor(__v) ^ __v);} |
| 7329 | } atomic_long; |
| 7330 | |
| 7331 | inline _LIBCPP_INLINE_VISIBILITY |
| 7332 | bool |
| 7333 | atomic_is_lock_free(const volatile atomic_long*) |
| 7334 | { |
| 7335 | typedef long type; |
| 7336 | return __atomic_is_lock_free(type); |
| 7337 | } |
| 7338 | |
| 7339 | inline _LIBCPP_INLINE_VISIBILITY |
| 7340 | bool |
| 7341 | atomic_is_lock_free(const atomic_long* __obj) |
| 7342 | { |
| 7343 | return atomic_is_lock_free(const_cast<volatile atomic_long*>(__obj)); |
| 7344 | } |
| 7345 | |
| 7346 | inline _LIBCPP_INLINE_VISIBILITY |
| 7347 | void |
| 7348 | atomic_init(volatile atomic_long* __obj, long __desr) |
| 7349 | { |
| 7350 | __obj->__v_ = __desr; |
| 7351 | } |
| 7352 | |
| 7353 | inline _LIBCPP_INLINE_VISIBILITY |
| 7354 | void |
| 7355 | atomic_init(atomic_long* __obj, long __desr) |
| 7356 | { |
| 7357 | __obj->__v_ = __desr; |
| 7358 | } |
| 7359 | |
| 7360 | inline _LIBCPP_INLINE_VISIBILITY |
| 7361 | void |
| 7362 | atomic_store(volatile atomic_long* __obj, long __desr) |
| 7363 | { |
| 7364 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 7365 | } |
| 7366 | |
| 7367 | inline _LIBCPP_INLINE_VISIBILITY |
| 7368 | void |
| 7369 | atomic_store(atomic_long* __obj, long __desr) |
| 7370 | { |
| 7371 | atomic_store(const_cast<volatile atomic_long*>(__obj), __desr); |
| 7372 | } |
| 7373 | |
| 7374 | inline _LIBCPP_INLINE_VISIBILITY |
| 7375 | void |
| 7376 | atomic_store_explicit(volatile atomic_long* __obj, long __desr, |
| 7377 | memory_order __o) |
| 7378 | { |
| 7379 | __atomic_store(&__obj->__v_, __desr, __o); |
| 7380 | } |
| 7381 | |
| 7382 | inline _LIBCPP_INLINE_VISIBILITY |
| 7383 | void |
| 7384 | atomic_store_explicit(atomic_long* __obj, long __desr, memory_order __o) |
| 7385 | { |
| 7386 | atomic_store_explicit(const_cast<volatile atomic_long*>(__obj), __desr, |
| 7387 | __o); |
| 7388 | } |
| 7389 | |
| 7390 | inline _LIBCPP_INLINE_VISIBILITY |
| 7391 | long |
| 7392 | atomic_load(const volatile atomic_long* __obj) |
| 7393 | { |
| 7394 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 7395 | } |
| 7396 | |
| 7397 | inline _LIBCPP_INLINE_VISIBILITY |
| 7398 | long |
| 7399 | atomic_load(const atomic_long* __obj) |
| 7400 | { |
| 7401 | return atomic_load(const_cast<const volatile atomic_long*>(__obj)); |
| 7402 | } |
| 7403 | |
| 7404 | inline _LIBCPP_INLINE_VISIBILITY |
| 7405 | long |
| 7406 | atomic_load_explicit(const volatile atomic_long* __obj, memory_order __o) |
| 7407 | { |
| 7408 | return __atomic_load(&__obj->__v_, __o); |
| 7409 | } |
| 7410 | |
| 7411 | inline _LIBCPP_INLINE_VISIBILITY |
| 7412 | long |
| 7413 | atomic_load_explicit(const atomic_long* __obj, memory_order __o) |
| 7414 | { |
| 7415 | return atomic_load_explicit(const_cast<const volatile atomic_long*> |
| 7416 | (__obj), __o); |
| 7417 | } |
| 7418 | |
| 7419 | inline _LIBCPP_INLINE_VISIBILITY |
| 7420 | long |
| 7421 | atomic_exchange(volatile atomic_long* __obj, long __desr) |
| 7422 | { |
| 7423 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 7424 | } |
| 7425 | |
| 7426 | inline _LIBCPP_INLINE_VISIBILITY |
| 7427 | long |
| 7428 | atomic_exchange(atomic_long* __obj, long __desr) |
| 7429 | { |
| 7430 | return atomic_exchange(const_cast<volatile atomic_long*>(__obj), __desr); |
| 7431 | } |
| 7432 | |
| 7433 | inline _LIBCPP_INLINE_VISIBILITY |
| 7434 | long |
| 7435 | atomic_exchange_explicit(volatile atomic_long* __obj, long __desr, |
| 7436 | memory_order __o) |
| 7437 | { |
| 7438 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 7439 | } |
| 7440 | |
| 7441 | inline _LIBCPP_INLINE_VISIBILITY |
| 7442 | long |
| 7443 | atomic_exchange_explicit(atomic_long* __obj, long __desr, memory_order __o) |
| 7444 | { |
| 7445 | return atomic_exchange_explicit(const_cast<volatile atomic_long*> |
| 7446 | (__obj), __desr, __o); |
| 7447 | } |
| 7448 | |
| 7449 | inline _LIBCPP_INLINE_VISIBILITY |
| 7450 | bool |
| 7451 | atomic_compare_exchange_weak(volatile atomic_long* __obj, long* __exp, |
| 7452 | long __desr) |
| 7453 | { |
| 7454 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 7455 | memory_order_seq_cst, memory_order_seq_cst); |
| 7456 | } |
| 7457 | |
| 7458 | inline _LIBCPP_INLINE_VISIBILITY |
| 7459 | bool |
| 7460 | atomic_compare_exchange_weak(atomic_long* __obj, long* __exp, long __desr) |
| 7461 | { |
| 7462 | return atomic_compare_exchange_weak(const_cast<volatile atomic_long*> |
| 7463 | (__obj), __exp, __desr); |
| 7464 | } |
| 7465 | |
| 7466 | inline _LIBCPP_INLINE_VISIBILITY |
| 7467 | bool |
| 7468 | atomic_compare_exchange_strong(volatile atomic_long* __obj, long* __exp, |
| 7469 | long __desr) |
| 7470 | { |
| 7471 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 7472 | memory_order_seq_cst, memory_order_seq_cst); |
| 7473 | } |
| 7474 | |
| 7475 | inline _LIBCPP_INLINE_VISIBILITY |
| 7476 | bool |
| 7477 | atomic_compare_exchange_strong(atomic_long* __obj, long* __exp, long __desr) |
| 7478 | { |
| 7479 | return atomic_compare_exchange_strong(const_cast<volatile atomic_long*> |
| 7480 | (__obj), __exp, __desr); |
| 7481 | } |
| 7482 | |
| 7483 | inline _LIBCPP_INLINE_VISIBILITY |
| 7484 | bool |
| 7485 | atomic_compare_exchange_weak_explicit(volatile atomic_long* __obj, long* __exp, |
| 7486 | long __desr, memory_order __s, |
| 7487 | memory_order __f) |
| 7488 | { |
| 7489 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 7490 | __f); |
| 7491 | } |
| 7492 | |
| 7493 | inline _LIBCPP_INLINE_VISIBILITY |
| 7494 | bool |
| 7495 | atomic_compare_exchange_weak_explicit(atomic_long* __obj, long* __exp, |
| 7496 | long __desr, memory_order __s, |
| 7497 | memory_order __f) |
| 7498 | { |
| 7499 | return atomic_compare_exchange_weak_explicit( |
| 7500 | const_cast<volatile atomic_long*>(__obj), __exp, __desr, __s, __f); |
| 7501 | } |
| 7502 | |
| 7503 | inline _LIBCPP_INLINE_VISIBILITY |
| 7504 | bool |
| 7505 | atomic_compare_exchange_strong_explicit(volatile atomic_long* __obj, |
| 7506 | long* __exp, long __desr, |
| 7507 | memory_order __s, memory_order __f) |
| 7508 | { |
| 7509 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 7510 | __f); |
| 7511 | } |
| 7512 | |
| 7513 | inline _LIBCPP_INLINE_VISIBILITY |
| 7514 | bool |
| 7515 | atomic_compare_exchange_strong_explicit(atomic_long* __obj, long* __exp, |
| 7516 | long __desr, memory_order __s, |
| 7517 | memory_order __f) |
| 7518 | { |
| 7519 | return atomic_compare_exchange_strong_explicit( |
| 7520 | const_cast<volatile atomic_long*>(__obj), __exp, __desr, __s, __f); |
| 7521 | } |
| 7522 | |
| 7523 | inline _LIBCPP_INLINE_VISIBILITY |
| 7524 | long |
| 7525 | atomic_fetch_add(volatile atomic_long* __obj, long __v) |
| 7526 | { |
| 7527 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 7528 | } |
| 7529 | |
| 7530 | inline _LIBCPP_INLINE_VISIBILITY |
| 7531 | long |
| 7532 | atomic_fetch_add(atomic_long* __obj, long __v) |
| 7533 | { |
| 7534 | return atomic_fetch_add(const_cast<volatile atomic_long*>(__obj), __v); |
| 7535 | } |
| 7536 | |
| 7537 | inline _LIBCPP_INLINE_VISIBILITY |
| 7538 | long |
| 7539 | atomic_fetch_add_explicit(volatile atomic_long* __obj, long __v, |
| 7540 | memory_order __o) |
| 7541 | { |
| 7542 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 7543 | } |
| 7544 | |
| 7545 | inline _LIBCPP_INLINE_VISIBILITY |
| 7546 | long |
| 7547 | atomic_fetch_add_explicit(atomic_long* __obj, long __v, memory_order __o) |
| 7548 | { |
| 7549 | return atomic_fetch_add_explicit(const_cast<volatile atomic_long*>(__obj), |
| 7550 | __v, __o); |
| 7551 | } |
| 7552 | |
| 7553 | inline _LIBCPP_INLINE_VISIBILITY |
| 7554 | long |
| 7555 | atomic_fetch_sub(volatile atomic_long* __obj, long __v) |
| 7556 | { |
| 7557 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 7558 | } |
| 7559 | |
| 7560 | inline _LIBCPP_INLINE_VISIBILITY |
| 7561 | long |
| 7562 | atomic_fetch_sub(atomic_long* __obj, long __v) |
| 7563 | { |
| 7564 | return atomic_fetch_sub(const_cast<volatile atomic_long*>(__obj), __v); |
| 7565 | } |
| 7566 | |
| 7567 | inline _LIBCPP_INLINE_VISIBILITY |
| 7568 | long |
| 7569 | atomic_fetch_sub_explicit(volatile atomic_long* __obj, long __v, |
| 7570 | memory_order __o) |
| 7571 | { |
| 7572 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 7573 | } |
| 7574 | |
| 7575 | inline _LIBCPP_INLINE_VISIBILITY |
| 7576 | long |
| 7577 | atomic_fetch_sub_explicit(atomic_long* __obj, long __v, memory_order __o) |
| 7578 | { |
| 7579 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_long*>(__obj), |
| 7580 | __v, __o); |
| 7581 | } |
| 7582 | |
| 7583 | inline _LIBCPP_INLINE_VISIBILITY |
| 7584 | long |
| 7585 | atomic_fetch_and(volatile atomic_long* __obj, long __v) |
| 7586 | { |
| 7587 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 7588 | } |
| 7589 | |
| 7590 | inline _LIBCPP_INLINE_VISIBILITY |
| 7591 | long |
| 7592 | atomic_fetch_and(atomic_long* __obj, long __v) |
| 7593 | { |
| 7594 | return atomic_fetch_and(const_cast<volatile atomic_long*>(__obj), __v); |
| 7595 | } |
| 7596 | |
| 7597 | inline _LIBCPP_INLINE_VISIBILITY |
| 7598 | long |
| 7599 | atomic_fetch_and_explicit(volatile atomic_long* __obj, long __v, |
| 7600 | memory_order __o) |
| 7601 | { |
| 7602 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 7603 | } |
| 7604 | |
| 7605 | inline _LIBCPP_INLINE_VISIBILITY |
| 7606 | long |
| 7607 | atomic_fetch_and_explicit(atomic_long* __obj, long __v, memory_order __o) |
| 7608 | { |
| 7609 | return atomic_fetch_and_explicit(const_cast<volatile atomic_long*>(__obj), |
| 7610 | __v, __o); |
| 7611 | } |
| 7612 | |
| 7613 | inline _LIBCPP_INLINE_VISIBILITY |
| 7614 | long |
| 7615 | atomic_fetch_or(volatile atomic_long* __obj, long __v) |
| 7616 | { |
| 7617 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 7618 | } |
| 7619 | |
| 7620 | inline _LIBCPP_INLINE_VISIBILITY |
| 7621 | long |
| 7622 | atomic_fetch_or(atomic_long* __obj, long __v) |
| 7623 | { |
| 7624 | return atomic_fetch_or(const_cast<volatile atomic_long*>(__obj), __v); |
| 7625 | } |
| 7626 | |
| 7627 | inline _LIBCPP_INLINE_VISIBILITY |
| 7628 | long |
| 7629 | atomic_fetch_or_explicit(volatile atomic_long* __obj, long __v, |
| 7630 | memory_order __o) |
| 7631 | { |
| 7632 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 7633 | } |
| 7634 | |
| 7635 | inline _LIBCPP_INLINE_VISIBILITY |
| 7636 | long |
| 7637 | atomic_fetch_or_explicit(atomic_long* __obj, long __v, memory_order __o) |
| 7638 | { |
| 7639 | return atomic_fetch_or_explicit(const_cast<volatile atomic_long*>(__obj), |
| 7640 | __v, __o); |
| 7641 | } |
| 7642 | |
| 7643 | inline _LIBCPP_INLINE_VISIBILITY |
| 7644 | long |
| 7645 | atomic_fetch_xor(volatile atomic_long* __obj, long __v) |
| 7646 | { |
| 7647 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 7648 | } |
| 7649 | |
| 7650 | inline _LIBCPP_INLINE_VISIBILITY |
| 7651 | long |
| 7652 | atomic_fetch_xor(atomic_long* __obj, long __v) |
| 7653 | { |
| 7654 | return atomic_fetch_xor(const_cast<volatile atomic_long*>(__obj), __v); |
| 7655 | } |
| 7656 | |
| 7657 | inline _LIBCPP_INLINE_VISIBILITY |
| 7658 | long |
| 7659 | atomic_fetch_xor_explicit(volatile atomic_long* __obj, long __v, |
| 7660 | memory_order __o) |
| 7661 | { |
| 7662 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 7663 | } |
| 7664 | |
| 7665 | inline _LIBCPP_INLINE_VISIBILITY |
| 7666 | long |
| 7667 | atomic_fetch_xor_explicit(atomic_long* __obj, long __v, memory_order __o) |
| 7668 | { |
| 7669 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_long*>(__obj), |
| 7670 | __v, __o); |
| 7671 | } |
| 7672 | |
| 7673 | // atomic_ulong |
| 7674 | |
| 7675 | struct atomic_ulong; |
| 7676 | |
| 7677 | bool atomic_is_lock_free(const volatile atomic_ulong*); |
| 7678 | bool atomic_is_lock_free(const atomic_ulong*); |
| 7679 | void atomic_init(volatile atomic_ulong*, unsigned long); |
| 7680 | void atomic_init(atomic_ulong*, unsigned long); |
| 7681 | void atomic_store(volatile atomic_ulong*, unsigned long); |
| 7682 | void atomic_store(atomic_ulong*, unsigned long); |
| 7683 | void atomic_store_explicit(volatile atomic_ulong*, unsigned long, memory_order); |
| 7684 | void atomic_store_explicit(atomic_ulong*, unsigned long, memory_order); |
| 7685 | unsigned long atomic_load(const volatile atomic_ulong*); |
| 7686 | unsigned long atomic_load(const atomic_ulong*); |
| 7687 | unsigned long atomic_load_explicit(const volatile atomic_ulong*, memory_order); |
| 7688 | unsigned long atomic_load_explicit(const atomic_ulong*, memory_order); |
| 7689 | unsigned long atomic_exchange(volatile atomic_ulong*, unsigned long); |
| 7690 | unsigned long atomic_exchange(atomic_ulong*, unsigned long); |
| 7691 | unsigned long atomic_exchange_explicit(volatile atomic_ulong*, unsigned long, |
| 7692 | memory_order); |
| 7693 | unsigned long atomic_exchange_explicit(atomic_ulong*, unsigned long, |
| 7694 | memory_order); |
| 7695 | bool atomic_compare_exchange_weak(volatile atomic_ulong*, unsigned long*, |
| 7696 | unsigned long); |
| 7697 | bool atomic_compare_exchange_weak(atomic_ulong*, unsigned long*, unsigned long); |
| 7698 | bool atomic_compare_exchange_strong(volatile atomic_ulong*, unsigned long*, |
| 7699 | unsigned long); |
| 7700 | bool atomic_compare_exchange_strong(atomic_ulong*, unsigned long*, |
| 7701 | unsigned long); |
| 7702 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ulong*, |
| 7703 | unsigned long*, unsigned long, |
| 7704 | memory_order, memory_order); |
| 7705 | bool atomic_compare_exchange_weak_explicit(atomic_ulong*, unsigned long*, |
| 7706 | unsigned long, memory_order, |
| 7707 | memory_order); |
| 7708 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ulong*, |
| 7709 | unsigned long*, unsigned long, |
| 7710 | memory_order, memory_order); |
| 7711 | bool atomic_compare_exchange_strong_explicit(atomic_ulong*, unsigned long*, |
| 7712 | unsigned long, memory_order, |
| 7713 | memory_order); |
| 7714 | unsigned long atomic_fetch_add(volatile atomic_ulong*, unsigned long); |
| 7715 | unsigned long atomic_fetch_add(atomic_ulong*, unsigned long); |
| 7716 | unsigned long atomic_fetch_add_explicit(volatile atomic_ulong*, unsigned long, |
| 7717 | memory_order); |
| 7718 | unsigned long atomic_fetch_add_explicit(atomic_ulong*, unsigned long, |
| 7719 | memory_order); |
| 7720 | unsigned long atomic_fetch_sub(volatile atomic_ulong*, unsigned long); |
| 7721 | unsigned long atomic_fetch_sub(atomic_ulong*, unsigned long); |
| 7722 | unsigned long atomic_fetch_sub_explicit(volatile atomic_ulong*, unsigned long, |
| 7723 | memory_order); |
| 7724 | unsigned long atomic_fetch_sub_explicit(atomic_ulong*, unsigned long, |
| 7725 | memory_order); |
| 7726 | unsigned long atomic_fetch_and(volatile atomic_ulong*, unsigned long); |
| 7727 | unsigned long atomic_fetch_and(atomic_ulong*, unsigned long); |
| 7728 | unsigned long atomic_fetch_and_explicit(volatile atomic_ulong*, unsigned long, |
| 7729 | memory_order); |
| 7730 | unsigned long atomic_fetch_and_explicit(atomic_ulong*, unsigned long, |
| 7731 | memory_order); |
| 7732 | unsigned long atomic_fetch_or(volatile atomic_ulong*, unsigned long); |
| 7733 | unsigned long atomic_fetch_or(atomic_ulong*, unsigned long); |
| 7734 | unsigned long atomic_fetch_or_explicit(volatile atomic_ulong*, unsigned long, |
| 7735 | memory_order); |
| 7736 | unsigned long atomic_fetch_or_explicit(atomic_ulong*, unsigned long, |
| 7737 | memory_order); |
| 7738 | unsigned long atomic_fetch_xor(volatile atomic_ulong*, unsigned long); |
| 7739 | unsigned long atomic_fetch_xor(atomic_ulong*, unsigned long); |
| 7740 | unsigned long atomic_fetch_xor_explicit(volatile atomic_ulong*, unsigned long, |
| 7741 | memory_order); |
| 7742 | unsigned long atomic_fetch_xor_explicit(atomic_ulong*, unsigned long, |
| 7743 | memory_order); |
| 7744 | |
| 7745 | typedef struct atomic_ulong |
| 7746 | { |
| 7747 | unsigned long __v_; |
| 7748 | |
| 7749 | _LIBCPP_INLINE_VISIBILITY |
| 7750 | bool is_lock_free() const volatile |
| 7751 | {return atomic_is_lock_free(this);} |
| 7752 | _LIBCPP_INLINE_VISIBILITY |
| 7753 | bool is_lock_free() const |
| 7754 | {return atomic_is_lock_free(this);} |
| 7755 | _LIBCPP_INLINE_VISIBILITY |
| 7756 | void store(unsigned long __v, |
| 7757 | memory_order __o = memory_order_seq_cst) volatile |
| 7758 | {atomic_store_explicit(this, __v, __o);} |
| 7759 | _LIBCPP_INLINE_VISIBILITY |
| 7760 | void store(unsigned long __v, memory_order __o = memory_order_seq_cst) |
| 7761 | {atomic_store_explicit(this, __v, __o);} |
| 7762 | _LIBCPP_INLINE_VISIBILITY |
| 7763 | unsigned long load(memory_order __o = memory_order_seq_cst) const volatile |
| 7764 | {return atomic_load_explicit(this, __o);} |
| 7765 | _LIBCPP_INLINE_VISIBILITY |
| 7766 | unsigned long load(memory_order __o = memory_order_seq_cst) const |
| 7767 | {return atomic_load_explicit(this, __o);} |
| 7768 | _LIBCPP_INLINE_VISIBILITY |
| 7769 | operator unsigned long() const volatile |
| 7770 | {return load();} |
| 7771 | _LIBCPP_INLINE_VISIBILITY |
| 7772 | operator unsigned long() const |
| 7773 | {return load();} |
| 7774 | _LIBCPP_INLINE_VISIBILITY |
| 7775 | unsigned long exchange(unsigned long __v, |
| 7776 | memory_order __o = memory_order_seq_cst) volatile |
| 7777 | {return atomic_exchange_explicit(this, __v, __o);} |
| 7778 | _LIBCPP_INLINE_VISIBILITY |
| 7779 | unsigned long exchange(unsigned long __v, |
| 7780 | memory_order __o = memory_order_seq_cst) |
| 7781 | {return atomic_exchange_explicit(this, __v, __o);} |
| 7782 | _LIBCPP_INLINE_VISIBILITY |
| 7783 | bool compare_exchange_weak(unsigned long& __v, unsigned long __e, |
| 7784 | memory_order __s, memory_order __f) volatile |
| 7785 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7786 | __f);} |
| 7787 | _LIBCPP_INLINE_VISIBILITY |
| 7788 | bool compare_exchange_weak(unsigned long& __v, unsigned long __e, |
| 7789 | memory_order __s, memory_order __f) |
| 7790 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7791 | __f);} |
| 7792 | _LIBCPP_INLINE_VISIBILITY |
| 7793 | bool compare_exchange_strong(unsigned long& __v, unsigned long __e, |
| 7794 | memory_order __s, memory_order __f) volatile |
| 7795 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7796 | __f);} |
| 7797 | _LIBCPP_INLINE_VISIBILITY |
| 7798 | bool compare_exchange_strong(unsigned long& __v, unsigned long __e, |
| 7799 | memory_order __s, memory_order __f) |
| 7800 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7801 | __f);} |
| 7802 | _LIBCPP_INLINE_VISIBILITY |
| 7803 | bool compare_exchange_weak(unsigned long& __v, unsigned long __e, |
| 7804 | memory_order __s = memory_order_seq_cst) volatile |
| 7805 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7806 | __translate_memory_order(__s));} |
| 7807 | _LIBCPP_INLINE_VISIBILITY |
| 7808 | bool compare_exchange_weak(unsigned long& __v, unsigned long __e, |
| 7809 | memory_order __s = memory_order_seq_cst) |
| 7810 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 7811 | __translate_memory_order(__s));} |
| 7812 | _LIBCPP_INLINE_VISIBILITY |
| 7813 | bool compare_exchange_strong(unsigned long& __v, unsigned long __e, |
| 7814 | memory_order __s = memory_order_seq_cst) volatile |
| 7815 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7816 | __translate_memory_order(__s));} |
| 7817 | _LIBCPP_INLINE_VISIBILITY |
| 7818 | bool compare_exchange_strong(unsigned long& __v, unsigned long __e, |
| 7819 | memory_order __s = memory_order_seq_cst) |
| 7820 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 7821 | __translate_memory_order(__s));} |
| 7822 | _LIBCPP_INLINE_VISIBILITY |
| 7823 | unsigned long fetch_add(unsigned long __v, |
| 7824 | memory_order __o = memory_order_seq_cst) volatile |
| 7825 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 7826 | _LIBCPP_INLINE_VISIBILITY |
| 7827 | unsigned long fetch_add(unsigned long __v, |
| 7828 | memory_order __o = memory_order_seq_cst) |
| 7829 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 7830 | _LIBCPP_INLINE_VISIBILITY |
| 7831 | unsigned long fetch_sub(unsigned long __v, |
| 7832 | memory_order __o = memory_order_seq_cst) volatile |
| 7833 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 7834 | _LIBCPP_INLINE_VISIBILITY |
| 7835 | unsigned long fetch_sub(unsigned long __v, |
| 7836 | memory_order __o = memory_order_seq_cst) |
| 7837 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 7838 | _LIBCPP_INLINE_VISIBILITY |
| 7839 | unsigned long fetch_and(unsigned long __v, |
| 7840 | memory_order __o = memory_order_seq_cst) volatile |
| 7841 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 7842 | _LIBCPP_INLINE_VISIBILITY |
| 7843 | unsigned long fetch_and(unsigned long __v, |
| 7844 | memory_order __o = memory_order_seq_cst) |
| 7845 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 7846 | _LIBCPP_INLINE_VISIBILITY |
| 7847 | unsigned long fetch_or(unsigned long __v, |
| 7848 | memory_order __o = memory_order_seq_cst) volatile |
| 7849 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 7850 | _LIBCPP_INLINE_VISIBILITY |
| 7851 | unsigned long fetch_or(unsigned long __v, |
| 7852 | memory_order __o = memory_order_seq_cst) |
| 7853 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 7854 | _LIBCPP_INLINE_VISIBILITY |
| 7855 | unsigned long fetch_xor(unsigned long __v, |
| 7856 | memory_order __o = memory_order_seq_cst) volatile |
| 7857 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 7858 | _LIBCPP_INLINE_VISIBILITY |
| 7859 | unsigned long fetch_xor(unsigned long __v, |
| 7860 | memory_order __o = memory_order_seq_cst) |
| 7861 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 7862 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 7863 | atomic_ulong() = default; |
| 7864 | #else |
| 7865 | _LIBCPP_INLINE_VISIBILITY |
| 7866 | atomic_ulong() {} |
| 7867 | #endif |
| 7868 | _LIBCPP_INLINE_VISIBILITY |
| 7869 | /*constexpr*/ atomic_ulong(unsigned long __v) |
| 7870 | : __v_(__v) {} |
| 7871 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 7872 | atomic_ulong(const atomic_ulong&) = delete; |
| 7873 | atomic_ulong& operator=(const atomic_ulong&) = delete; |
| 7874 | atomic_ulong& operator=(const atomic_ulong&) volatile = delete; |
| 7875 | #else |
| 7876 | private: |
| 7877 | atomic_ulong(const atomic_ulong&); |
| 7878 | atomic_ulong& operator=(const atomic_ulong&); |
| 7879 | atomic_ulong& operator=(const atomic_ulong&) volatile; |
| 7880 | public: |
| 7881 | #endif |
| 7882 | _LIBCPP_INLINE_VISIBILITY |
| 7883 | unsigned long operator=(unsigned long __v) volatile |
| 7884 | {store(__v); return __v;} |
| 7885 | _LIBCPP_INLINE_VISIBILITY |
| 7886 | unsigned long operator=(unsigned long __v) |
| 7887 | {store(__v); return __v;} |
| 7888 | _LIBCPP_INLINE_VISIBILITY |
| 7889 | unsigned long operator++(int) volatile |
| 7890 | {typedef unsigned long type; return fetch_add(type(1));} |
| 7891 | _LIBCPP_INLINE_VISIBILITY |
| 7892 | long operator++(int) |
| 7893 | {typedef unsigned long type; return fetch_add(type(1));} |
| 7894 | _LIBCPP_INLINE_VISIBILITY |
| 7895 | long operator--(int) volatile |
| 7896 | {typedef unsigned long type; return fetch_sub(type(1));} |
| 7897 | _LIBCPP_INLINE_VISIBILITY |
| 7898 | long operator--(int) |
| 7899 | {typedef unsigned long type; return fetch_sub(type(1));} |
| 7900 | _LIBCPP_INLINE_VISIBILITY |
| 7901 | long operator++() volatile |
| 7902 | {typedef unsigned long type; return type(fetch_add(type(1)) + 1);} |
| 7903 | _LIBCPP_INLINE_VISIBILITY |
| 7904 | long operator++() |
| 7905 | {typedef unsigned long type; return type(fetch_add(type(1)) + 1);} |
| 7906 | _LIBCPP_INLINE_VISIBILITY |
| 7907 | long operator--() volatile |
| 7908 | {typedef unsigned long type; return type(fetch_sub(type(1)) - 1);} |
| 7909 | _LIBCPP_INLINE_VISIBILITY |
| 7910 | long operator--() |
| 7911 | {typedef unsigned long type; return type(fetch_sub(type(1)) - 1);} |
| 7912 | _LIBCPP_INLINE_VISIBILITY |
| 7913 | long operator+=(long __v) volatile |
| 7914 | {typedef unsigned long type; return type(fetch_add(__v) + __v);} |
| 7915 | _LIBCPP_INLINE_VISIBILITY |
| 7916 | long operator+=(long __v) |
| 7917 | {typedef unsigned long type; return type(fetch_add(__v) + __v);} |
| 7918 | _LIBCPP_INLINE_VISIBILITY |
| 7919 | long operator-=(long __v) volatile |
| 7920 | {typedef unsigned long type; return type(fetch_sub(__v) - __v);} |
| 7921 | _LIBCPP_INLINE_VISIBILITY |
| 7922 | long operator-=(long __v) |
| 7923 | {typedef unsigned long type; return type(fetch_sub(__v) - __v);} |
| 7924 | _LIBCPP_INLINE_VISIBILITY |
| 7925 | long operator&=(long __v) volatile |
| 7926 | {typedef unsigned long type; return type(fetch_and(__v) & __v);} |
| 7927 | _LIBCPP_INLINE_VISIBILITY |
| 7928 | long operator&=(long __v) |
| 7929 | {typedef unsigned long type; return type(fetch_and(__v) & __v);} |
| 7930 | _LIBCPP_INLINE_VISIBILITY |
| 7931 | long operator|=(long __v) volatile |
| 7932 | {typedef unsigned long type; return type(fetch_or(__v) | __v);} |
| 7933 | _LIBCPP_INLINE_VISIBILITY |
| 7934 | long operator|=(long __v) |
| 7935 | {typedef unsigned long type; return type(fetch_or(__v) | __v);} |
| 7936 | _LIBCPP_INLINE_VISIBILITY |
| 7937 | long operator^=(long __v) volatile |
| 7938 | {typedef unsigned long type; return type(fetch_xor(__v) ^ __v);} |
| 7939 | _LIBCPP_INLINE_VISIBILITY |
| 7940 | long operator^=(long __v) |
| 7941 | {typedef unsigned long type; return type(fetch_xor(__v) ^ __v);} |
| 7942 | } atomic_ulong; |
| 7943 | |
| 7944 | inline _LIBCPP_INLINE_VISIBILITY |
| 7945 | bool |
| 7946 | atomic_is_lock_free(const volatile atomic_ulong*) |
| 7947 | { |
| 7948 | typedef unsigned long type; |
| 7949 | return __atomic_is_lock_free(type); |
| 7950 | } |
| 7951 | |
| 7952 | inline _LIBCPP_INLINE_VISIBILITY |
| 7953 | bool |
| 7954 | atomic_is_lock_free(const atomic_ulong* __obj) |
| 7955 | { |
| 7956 | return atomic_is_lock_free(const_cast<volatile atomic_ulong*>(__obj)); |
| 7957 | } |
| 7958 | |
| 7959 | inline _LIBCPP_INLINE_VISIBILITY |
| 7960 | void |
| 7961 | atomic_init(volatile atomic_ulong* __obj, unsigned long __desr) |
| 7962 | { |
| 7963 | __obj->__v_ = __desr; |
| 7964 | } |
| 7965 | |
| 7966 | inline _LIBCPP_INLINE_VISIBILITY |
| 7967 | void |
| 7968 | atomic_init(atomic_ulong* __obj, unsigned long __desr) |
| 7969 | { |
| 7970 | __obj->__v_ = __desr; |
| 7971 | } |
| 7972 | |
| 7973 | inline _LIBCPP_INLINE_VISIBILITY |
| 7974 | void |
| 7975 | atomic_store(volatile atomic_ulong* __obj, unsigned long __desr) |
| 7976 | { |
| 7977 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 7978 | } |
| 7979 | |
| 7980 | inline _LIBCPP_INLINE_VISIBILITY |
| 7981 | void |
| 7982 | atomic_store(atomic_ulong* __obj, unsigned long __desr) |
| 7983 | { |
| 7984 | atomic_store(const_cast<volatile atomic_ulong*>(__obj), __desr); |
| 7985 | } |
| 7986 | |
| 7987 | inline _LIBCPP_INLINE_VISIBILITY |
| 7988 | void |
| 7989 | atomic_store_explicit(volatile atomic_ulong* __obj, unsigned long __desr, |
| 7990 | memory_order __o) |
| 7991 | { |
| 7992 | __atomic_store(&__obj->__v_, __desr, __o); |
| 7993 | } |
| 7994 | |
| 7995 | inline _LIBCPP_INLINE_VISIBILITY |
| 7996 | void |
| 7997 | atomic_store_explicit(atomic_ulong* __obj, unsigned long __desr, |
| 7998 | memory_order __o) |
| 7999 | { |
| 8000 | atomic_store_explicit(const_cast<volatile atomic_ulong*>(__obj), __desr, |
| 8001 | __o); |
| 8002 | } |
| 8003 | |
| 8004 | inline _LIBCPP_INLINE_VISIBILITY |
| 8005 | unsigned long |
| 8006 | atomic_load(const volatile atomic_ulong* __obj) |
| 8007 | { |
| 8008 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 8009 | } |
| 8010 | |
| 8011 | inline _LIBCPP_INLINE_VISIBILITY |
| 8012 | unsigned long |
| 8013 | atomic_load(const atomic_ulong* __obj) |
| 8014 | { |
| 8015 | return atomic_load(const_cast<const volatile atomic_ulong*>(__obj)); |
| 8016 | } |
| 8017 | |
| 8018 | inline _LIBCPP_INLINE_VISIBILITY |
| 8019 | unsigned long |
| 8020 | atomic_load_explicit(const volatile atomic_ulong* __obj, memory_order __o) |
| 8021 | { |
| 8022 | return __atomic_load(&__obj->__v_, __o); |
| 8023 | } |
| 8024 | |
| 8025 | inline _LIBCPP_INLINE_VISIBILITY |
| 8026 | unsigned long |
| 8027 | atomic_load_explicit(const atomic_ulong* __obj, memory_order __o) |
| 8028 | { |
| 8029 | return atomic_load_explicit(const_cast<const volatile atomic_ulong*> |
| 8030 | (__obj), __o); |
| 8031 | } |
| 8032 | |
| 8033 | inline _LIBCPP_INLINE_VISIBILITY |
| 8034 | unsigned long |
| 8035 | atomic_exchange(volatile atomic_ulong* __obj, unsigned long __desr) |
| 8036 | { |
| 8037 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 8038 | } |
| 8039 | |
| 8040 | inline _LIBCPP_INLINE_VISIBILITY |
| 8041 | unsigned long |
| 8042 | atomic_exchange(atomic_ulong* __obj, unsigned long __desr) |
| 8043 | { |
| 8044 | return atomic_exchange(const_cast<volatile atomic_ulong*>(__obj), __desr); |
| 8045 | } |
| 8046 | |
| 8047 | inline _LIBCPP_INLINE_VISIBILITY |
| 8048 | unsigned long |
| 8049 | atomic_exchange_explicit(volatile atomic_ulong* __obj, unsigned long __desr, |
| 8050 | memory_order __o) |
| 8051 | { |
| 8052 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 8053 | } |
| 8054 | |
| 8055 | inline _LIBCPP_INLINE_VISIBILITY |
| 8056 | unsigned long |
| 8057 | atomic_exchange_explicit(atomic_ulong* __obj, unsigned long __desr, |
| 8058 | memory_order __o) |
| 8059 | { |
| 8060 | return atomic_exchange_explicit(const_cast<volatile atomic_ulong*> |
| 8061 | (__obj), __desr, __o); |
| 8062 | } |
| 8063 | |
| 8064 | inline _LIBCPP_INLINE_VISIBILITY |
| 8065 | bool |
| 8066 | atomic_compare_exchange_weak(volatile atomic_ulong* __obj, unsigned long* __exp, |
| 8067 | unsigned long __desr) |
| 8068 | { |
| 8069 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 8070 | memory_order_seq_cst, memory_order_seq_cst); |
| 8071 | } |
| 8072 | |
| 8073 | inline _LIBCPP_INLINE_VISIBILITY |
| 8074 | bool |
| 8075 | atomic_compare_exchange_weak(atomic_ulong* __obj, unsigned long* __exp, |
| 8076 | unsigned long __desr) |
| 8077 | { |
| 8078 | return atomic_compare_exchange_weak(const_cast<volatile atomic_ulong*> |
| 8079 | (__obj), __exp, __desr); |
| 8080 | } |
| 8081 | |
| 8082 | inline _LIBCPP_INLINE_VISIBILITY |
| 8083 | bool |
| 8084 | atomic_compare_exchange_strong(volatile atomic_ulong* __obj, |
| 8085 | unsigned long* __exp, unsigned long __desr) |
| 8086 | { |
| 8087 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 8088 | memory_order_seq_cst, memory_order_seq_cst); |
| 8089 | } |
| 8090 | |
| 8091 | inline _LIBCPP_INLINE_VISIBILITY |
| 8092 | bool |
| 8093 | atomic_compare_exchange_strong(atomic_ulong* __obj, unsigned long* __exp, |
| 8094 | unsigned long __desr) |
| 8095 | { |
| 8096 | return atomic_compare_exchange_strong(const_cast<volatile atomic_ulong*> |
| 8097 | (__obj), __exp, __desr); |
| 8098 | } |
| 8099 | |
| 8100 | inline _LIBCPP_INLINE_VISIBILITY |
| 8101 | bool |
| 8102 | atomic_compare_exchange_weak_explicit(volatile atomic_ulong* __obj, |
| 8103 | unsigned long* __exp, |
| 8104 | unsigned long __desr, memory_order __s, |
| 8105 | memory_order __f) |
| 8106 | { |
| 8107 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 8108 | __f); |
| 8109 | } |
| 8110 | |
| 8111 | inline _LIBCPP_INLINE_VISIBILITY |
| 8112 | bool |
| 8113 | atomic_compare_exchange_weak_explicit(atomic_ulong* __obj, unsigned long* __exp, |
| 8114 | unsigned long __desr, memory_order __s, |
| 8115 | memory_order __f) |
| 8116 | { |
| 8117 | return atomic_compare_exchange_weak_explicit( |
| 8118 | const_cast<volatile atomic_ulong*>(__obj), __exp, __desr, __s, __f); |
| 8119 | } |
| 8120 | |
| 8121 | inline _LIBCPP_INLINE_VISIBILITY |
| 8122 | bool |
| 8123 | atomic_compare_exchange_strong_explicit(volatile atomic_ulong* __obj, |
| 8124 | unsigned long* __exp, |
| 8125 | unsigned long __desr, memory_order __s, |
| 8126 | memory_order __f) |
| 8127 | { |
| 8128 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 8129 | __f); |
| 8130 | } |
| 8131 | |
| 8132 | inline _LIBCPP_INLINE_VISIBILITY |
| 8133 | bool |
| 8134 | atomic_compare_exchange_strong_explicit(atomic_ulong* __obj, |
| 8135 | unsigned long* __exp, |
| 8136 | unsigned long __desr, memory_order __s, |
| 8137 | memory_order __f) |
| 8138 | { |
| 8139 | return atomic_compare_exchange_strong_explicit( |
| 8140 | const_cast<volatile atomic_ulong*>(__obj), __exp, __desr, __s, __f); |
| 8141 | } |
| 8142 | |
| 8143 | inline _LIBCPP_INLINE_VISIBILITY |
| 8144 | unsigned long |
| 8145 | atomic_fetch_add(volatile atomic_ulong* __obj, unsigned long __v) |
| 8146 | { |
| 8147 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 8148 | } |
| 8149 | |
| 8150 | inline _LIBCPP_INLINE_VISIBILITY |
| 8151 | unsigned long |
| 8152 | atomic_fetch_add(atomic_ulong* __obj, unsigned long __v) |
| 8153 | { |
| 8154 | return atomic_fetch_add(const_cast<volatile atomic_ulong*>(__obj), __v); |
| 8155 | } |
| 8156 | |
| 8157 | inline _LIBCPP_INLINE_VISIBILITY |
| 8158 | unsigned long |
| 8159 | atomic_fetch_add_explicit(volatile atomic_ulong* __obj, unsigned long __v, |
| 8160 | memory_order __o) |
| 8161 | { |
| 8162 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 8163 | } |
| 8164 | |
| 8165 | inline _LIBCPP_INLINE_VISIBILITY |
| 8166 | unsigned long |
| 8167 | atomic_fetch_add_explicit(atomic_ulong* __obj, unsigned long __v, |
| 8168 | memory_order __o) |
| 8169 | { |
| 8170 | return atomic_fetch_add_explicit(const_cast<volatile atomic_ulong*>(__obj), |
| 8171 | __v, __o); |
| 8172 | } |
| 8173 | |
| 8174 | inline _LIBCPP_INLINE_VISIBILITY |
| 8175 | unsigned long |
| 8176 | atomic_fetch_sub(volatile atomic_ulong* __obj, unsigned long __v) |
| 8177 | { |
| 8178 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 8179 | } |
| 8180 | |
| 8181 | inline _LIBCPP_INLINE_VISIBILITY |
| 8182 | unsigned long |
| 8183 | atomic_fetch_sub(atomic_ulong* __obj, unsigned long __v) |
| 8184 | { |
| 8185 | return atomic_fetch_sub(const_cast<volatile atomic_ulong*>(__obj), __v); |
| 8186 | } |
| 8187 | |
| 8188 | inline _LIBCPP_INLINE_VISIBILITY |
| 8189 | unsigned long |
| 8190 | atomic_fetch_sub_explicit(volatile atomic_ulong* __obj, unsigned long __v, |
| 8191 | memory_order __o) |
| 8192 | { |
| 8193 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 8194 | } |
| 8195 | |
| 8196 | inline _LIBCPP_INLINE_VISIBILITY |
| 8197 | unsigned long |
| 8198 | atomic_fetch_sub_explicit(atomic_ulong* __obj, unsigned long __v, |
| 8199 | memory_order __o) |
| 8200 | { |
| 8201 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_ulong*>(__obj), |
| 8202 | __v, __o); |
| 8203 | } |
| 8204 | |
| 8205 | inline _LIBCPP_INLINE_VISIBILITY |
| 8206 | unsigned long |
| 8207 | atomic_fetch_and(volatile atomic_ulong* __obj, unsigned long __v) |
| 8208 | { |
| 8209 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 8210 | } |
| 8211 | |
| 8212 | inline _LIBCPP_INLINE_VISIBILITY |
| 8213 | unsigned long |
| 8214 | atomic_fetch_and(atomic_ulong* __obj, unsigned long __v) |
| 8215 | { |
| 8216 | return atomic_fetch_and(const_cast<volatile atomic_ulong*>(__obj), __v); |
| 8217 | } |
| 8218 | |
| 8219 | inline _LIBCPP_INLINE_VISIBILITY |
| 8220 | unsigned long |
| 8221 | atomic_fetch_and_explicit(volatile atomic_ulong* __obj, unsigned long __v, |
| 8222 | memory_order __o) |
| 8223 | { |
| 8224 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 8225 | } |
| 8226 | |
| 8227 | inline _LIBCPP_INLINE_VISIBILITY |
| 8228 | unsigned long |
| 8229 | atomic_fetch_and_explicit(atomic_ulong* __obj, unsigned long __v, |
| 8230 | memory_order __o) |
| 8231 | { |
| 8232 | return atomic_fetch_and_explicit(const_cast<volatile atomic_ulong*>(__obj), |
| 8233 | __v, __o); |
| 8234 | } |
| 8235 | |
| 8236 | inline _LIBCPP_INLINE_VISIBILITY |
| 8237 | unsigned long |
| 8238 | atomic_fetch_or(volatile atomic_ulong* __obj, unsigned long __v) |
| 8239 | { |
| 8240 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 8241 | } |
| 8242 | |
| 8243 | inline _LIBCPP_INLINE_VISIBILITY |
| 8244 | unsigned long |
| 8245 | atomic_fetch_or(atomic_ulong* __obj, unsigned long __v) |
| 8246 | { |
| 8247 | return atomic_fetch_or(const_cast<volatile atomic_ulong*>(__obj), __v); |
| 8248 | } |
| 8249 | |
| 8250 | inline _LIBCPP_INLINE_VISIBILITY |
| 8251 | unsigned long |
| 8252 | atomic_fetch_or_explicit(volatile atomic_ulong* __obj, unsigned long __v, |
| 8253 | memory_order __o) |
| 8254 | { |
| 8255 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 8256 | } |
| 8257 | |
| 8258 | inline _LIBCPP_INLINE_VISIBILITY |
| 8259 | unsigned long |
| 8260 | atomic_fetch_or_explicit(atomic_ulong* __obj, unsigned long __v, |
| 8261 | memory_order __o) |
| 8262 | { |
| 8263 | return atomic_fetch_or_explicit(const_cast<volatile atomic_ulong*>(__obj), |
| 8264 | __v, __o); |
| 8265 | } |
| 8266 | |
| 8267 | inline _LIBCPP_INLINE_VISIBILITY |
| 8268 | unsigned long |
| 8269 | atomic_fetch_xor(volatile atomic_ulong* __obj, unsigned long __v) |
| 8270 | { |
| 8271 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 8272 | } |
| 8273 | |
| 8274 | inline _LIBCPP_INLINE_VISIBILITY |
| 8275 | unsigned long |
| 8276 | atomic_fetch_xor(atomic_ulong* __obj, unsigned long __v) |
| 8277 | { |
| 8278 | return atomic_fetch_xor(const_cast<volatile atomic_ulong*>(__obj), __v); |
| 8279 | } |
| 8280 | |
| 8281 | inline _LIBCPP_INLINE_VISIBILITY |
| 8282 | unsigned long |
| 8283 | atomic_fetch_xor_explicit(volatile atomic_ulong* __obj, unsigned long __v, |
| 8284 | memory_order __o) |
| 8285 | { |
| 8286 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 8287 | } |
| 8288 | |
| 8289 | inline _LIBCPP_INLINE_VISIBILITY |
| 8290 | unsigned long |
| 8291 | atomic_fetch_xor_explicit(atomic_ulong* __obj, unsigned long __v, |
| 8292 | memory_order __o) |
| 8293 | { |
| 8294 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_ulong*>(__obj), |
| 8295 | __v, __o); |
| 8296 | } |
| 8297 | |
| 8298 | // atomic_llong |
| 8299 | |
| 8300 | struct atomic_llong; |
| 8301 | |
| 8302 | bool atomic_is_lock_free(const volatile atomic_llong*); |
| 8303 | bool atomic_is_lock_free(const atomic_llong*); |
| 8304 | void atomic_init(volatile atomic_llong*, long long); |
| 8305 | void atomic_init(atomic_llong*, long long); |
| 8306 | void atomic_store(volatile atomic_llong*, long long); |
| 8307 | void atomic_store(atomic_llong*, long long); |
| 8308 | void atomic_store_explicit(volatile atomic_llong*, long long, memory_order); |
| 8309 | void atomic_store_explicit(atomic_llong*, long long, memory_order); |
| 8310 | long long atomic_load(const volatile atomic_llong*); |
| 8311 | long long atomic_load(const atomic_llong*); |
| 8312 | long long atomic_load_explicit(const volatile atomic_llong*, memory_order); |
| 8313 | long long atomic_load_explicit(const atomic_llong*, memory_order); |
| 8314 | long long atomic_exchange(volatile atomic_llong*, long long); |
| 8315 | long long atomic_exchange(atomic_llong*, long long); |
| 8316 | long long atomic_exchange_explicit(volatile atomic_llong*, long long, |
| 8317 | memory_order); |
| 8318 | long long atomic_exchange_explicit(atomic_llong*, long long, |
| 8319 | memory_order); |
| 8320 | bool atomic_compare_exchange_weak(volatile atomic_llong*, long long*, |
| 8321 | long long); |
| 8322 | bool atomic_compare_exchange_weak(atomic_llong*, long long*, long long); |
| 8323 | bool atomic_compare_exchange_strong(volatile atomic_llong*, long long*, |
| 8324 | long long); |
| 8325 | bool atomic_compare_exchange_strong(atomic_llong*, long long*, |
| 8326 | long long); |
| 8327 | bool atomic_compare_exchange_weak_explicit(volatile atomic_llong*, |
| 8328 | long long*, long long, |
| 8329 | memory_order, memory_order); |
| 8330 | bool atomic_compare_exchange_weak_explicit(atomic_llong*, long long*, |
| 8331 | long long, memory_order, |
| 8332 | memory_order); |
| 8333 | bool atomic_compare_exchange_strong_explicit(volatile atomic_llong*, |
| 8334 | long long*, long long, |
| 8335 | memory_order, memory_order); |
| 8336 | bool atomic_compare_exchange_strong_explicit(atomic_llong*, long long*, |
| 8337 | long long, memory_order, |
| 8338 | memory_order); |
| 8339 | long long atomic_fetch_add(volatile atomic_llong*, long long); |
| 8340 | long long atomic_fetch_add(atomic_llong*, long long); |
| 8341 | long long atomic_fetch_add_explicit(volatile atomic_llong*, long long, |
| 8342 | memory_order); |
| 8343 | long long atomic_fetch_add_explicit(atomic_llong*, long long, |
| 8344 | memory_order); |
| 8345 | long long atomic_fetch_sub(volatile atomic_llong*, long long); |
| 8346 | long long atomic_fetch_sub(atomic_llong*, long long); |
| 8347 | long long atomic_fetch_sub_explicit(volatile atomic_llong*, long long, |
| 8348 | memory_order); |
| 8349 | long long atomic_fetch_sub_explicit(atomic_llong*, long long, |
| 8350 | memory_order); |
| 8351 | long long atomic_fetch_and(volatile atomic_llong*, long long); |
| 8352 | long long atomic_fetch_and(atomic_llong*, long long); |
| 8353 | long long atomic_fetch_and_explicit(volatile atomic_llong*, long long, |
| 8354 | memory_order); |
| 8355 | long long atomic_fetch_and_explicit(atomic_llong*, long long, |
| 8356 | memory_order); |
| 8357 | long long atomic_fetch_or(volatile atomic_llong*, long long); |
| 8358 | long long atomic_fetch_or(atomic_llong*, long long); |
| 8359 | long long atomic_fetch_or_explicit(volatile atomic_llong*, long long, |
| 8360 | memory_order); |
| 8361 | long long atomic_fetch_or_explicit(atomic_llong*, long long, |
| 8362 | memory_order); |
| 8363 | long long atomic_fetch_xor(volatile atomic_llong*, long long); |
| 8364 | long long atomic_fetch_xor(atomic_llong*, long long); |
| 8365 | long long atomic_fetch_xor_explicit(volatile atomic_llong*, long long, |
| 8366 | memory_order); |
| 8367 | long long atomic_fetch_xor_explicit(atomic_llong*, long long, |
| 8368 | memory_order); |
| 8369 | |
| 8370 | typedef struct atomic_llong |
| 8371 | { |
| 8372 | long long __v_; |
| 8373 | |
| 8374 | _LIBCPP_INLINE_VISIBILITY |
| 8375 | bool is_lock_free() const volatile |
| 8376 | {return atomic_is_lock_free(this);} |
| 8377 | _LIBCPP_INLINE_VISIBILITY |
| 8378 | bool is_lock_free() const |
| 8379 | {return atomic_is_lock_free(this);} |
| 8380 | _LIBCPP_INLINE_VISIBILITY |
| 8381 | void store(long long __v, |
| 8382 | memory_order __o = memory_order_seq_cst) volatile |
| 8383 | {atomic_store_explicit(this, __v, __o);} |
| 8384 | _LIBCPP_INLINE_VISIBILITY |
| 8385 | void store(long long __v, memory_order __o = memory_order_seq_cst) |
| 8386 | {atomic_store_explicit(this, __v, __o);} |
| 8387 | _LIBCPP_INLINE_VISIBILITY |
| 8388 | long long load(memory_order __o = memory_order_seq_cst) const volatile |
| 8389 | {return atomic_load_explicit(this, __o);} |
| 8390 | _LIBCPP_INLINE_VISIBILITY |
| 8391 | long long load(memory_order __o = memory_order_seq_cst) const |
| 8392 | {return atomic_load_explicit(this, __o);} |
| 8393 | _LIBCPP_INLINE_VISIBILITY |
| 8394 | operator long long() const volatile |
| 8395 | {return load();} |
| 8396 | _LIBCPP_INLINE_VISIBILITY |
| 8397 | operator long long() const |
| 8398 | {return load();} |
| 8399 | _LIBCPP_INLINE_VISIBILITY |
| 8400 | long long exchange(long long __v, |
| 8401 | memory_order __o = memory_order_seq_cst) volatile |
| 8402 | {return atomic_exchange_explicit(this, __v, __o);} |
| 8403 | _LIBCPP_INLINE_VISIBILITY |
| 8404 | long long exchange(long long __v, |
| 8405 | memory_order __o = memory_order_seq_cst) |
| 8406 | {return atomic_exchange_explicit(this, __v, __o);} |
| 8407 | _LIBCPP_INLINE_VISIBILITY |
| 8408 | bool compare_exchange_weak(long long& __v, long long __e, |
| 8409 | memory_order __s, memory_order __f) volatile |
| 8410 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 8411 | __f);} |
| 8412 | _LIBCPP_INLINE_VISIBILITY |
| 8413 | bool compare_exchange_weak(long long& __v, long long __e, |
| 8414 | memory_order __s, memory_order __f) |
| 8415 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 8416 | __f);} |
| 8417 | _LIBCPP_INLINE_VISIBILITY |
| 8418 | bool compare_exchange_strong(long long& __v, long long __e, |
| 8419 | memory_order __s, memory_order __f) volatile |
| 8420 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 8421 | __f);} |
| 8422 | _LIBCPP_INLINE_VISIBILITY |
| 8423 | bool compare_exchange_strong(long long& __v, long long __e, |
| 8424 | memory_order __s, memory_order __f) |
| 8425 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 8426 | __f);} |
| 8427 | _LIBCPP_INLINE_VISIBILITY |
| 8428 | bool compare_exchange_weak(long long& __v, long long __e, |
| 8429 | memory_order __s = memory_order_seq_cst) volatile |
| 8430 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 8431 | __translate_memory_order(__s));} |
| 8432 | _LIBCPP_INLINE_VISIBILITY |
| 8433 | bool compare_exchange_weak(long long& __v, long long __e, |
| 8434 | memory_order __s = memory_order_seq_cst) |
| 8435 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 8436 | __translate_memory_order(__s));} |
| 8437 | _LIBCPP_INLINE_VISIBILITY |
| 8438 | bool compare_exchange_strong(long long& __v, long long __e, |
| 8439 | memory_order __s = memory_order_seq_cst) volatile |
| 8440 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 8441 | __translate_memory_order(__s));} |
| 8442 | _LIBCPP_INLINE_VISIBILITY |
| 8443 | bool compare_exchange_strong(long long& __v, long long __e, |
| 8444 | memory_order __s = memory_order_seq_cst) |
| 8445 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 8446 | __translate_memory_order(__s));} |
| 8447 | _LIBCPP_INLINE_VISIBILITY |
| 8448 | long long fetch_add(long long __v, |
| 8449 | memory_order __o = memory_order_seq_cst) volatile |
| 8450 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 8451 | _LIBCPP_INLINE_VISIBILITY |
| 8452 | long long fetch_add(long long __v, |
| 8453 | memory_order __o = memory_order_seq_cst) |
| 8454 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 8455 | _LIBCPP_INLINE_VISIBILITY |
| 8456 | long long fetch_sub(long long __v, |
| 8457 | memory_order __o = memory_order_seq_cst) volatile |
| 8458 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 8459 | _LIBCPP_INLINE_VISIBILITY |
| 8460 | long long fetch_sub(long long __v, |
| 8461 | memory_order __o = memory_order_seq_cst) |
| 8462 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 8463 | _LIBCPP_INLINE_VISIBILITY |
| 8464 | long long fetch_and(long long __v, |
| 8465 | memory_order __o = memory_order_seq_cst) volatile |
| 8466 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 8467 | _LIBCPP_INLINE_VISIBILITY |
| 8468 | long long fetch_and(long long __v, |
| 8469 | memory_order __o = memory_order_seq_cst) |
| 8470 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 8471 | _LIBCPP_INLINE_VISIBILITY |
| 8472 | long long fetch_or(long long __v, |
| 8473 | memory_order __o = memory_order_seq_cst) volatile |
| 8474 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 8475 | _LIBCPP_INLINE_VISIBILITY |
| 8476 | long long fetch_or(long long __v, |
| 8477 | memory_order __o = memory_order_seq_cst) |
| 8478 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 8479 | _LIBCPP_INLINE_VISIBILITY |
| 8480 | long long fetch_xor(long long __v, |
| 8481 | memory_order __o = memory_order_seq_cst) volatile |
| 8482 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 8483 | _LIBCPP_INLINE_VISIBILITY |
| 8484 | long long fetch_xor(long long __v, |
| 8485 | memory_order __o = memory_order_seq_cst) |
| 8486 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 8487 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 8488 | atomic_llong() = default; |
| 8489 | #else |
| 8490 | _LIBCPP_INLINE_VISIBILITY |
| 8491 | atomic_llong() {} |
| 8492 | #endif |
| 8493 | _LIBCPP_INLINE_VISIBILITY |
| 8494 | /*constexpr*/ atomic_llong(long long __v) |
| 8495 | : __v_(__v) {} |
| 8496 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 8497 | atomic_llong(const atomic_llong&) = delete; |
| 8498 | atomic_llong& operator=(const atomic_llong&) = delete; |
| 8499 | atomic_llong& operator=(const atomic_llong&) volatile = delete; |
| 8500 | #else |
| 8501 | private: |
| 8502 | atomic_llong(const atomic_llong&); |
| 8503 | atomic_llong& operator=(const atomic_llong&); |
| 8504 | atomic_llong& operator=(const atomic_llong&) volatile; |
| 8505 | public: |
| 8506 | #endif |
| 8507 | _LIBCPP_INLINE_VISIBILITY |
| 8508 | long long operator=(long long __v) volatile |
| 8509 | {store(__v); return __v;} |
| 8510 | _LIBCPP_INLINE_VISIBILITY |
| 8511 | long long operator=(long long __v) |
| 8512 | {store(__v); return __v;} |
| 8513 | _LIBCPP_INLINE_VISIBILITY |
| 8514 | long long operator++(int) volatile |
| 8515 | {typedef long long type; return fetch_add(type(1));} |
| 8516 | _LIBCPP_INLINE_VISIBILITY |
| 8517 | long operator++(int) |
| 8518 | {typedef long long type; return fetch_add(type(1));} |
| 8519 | _LIBCPP_INLINE_VISIBILITY |
| 8520 | long operator--(int) volatile |
| 8521 | {typedef long long type; return fetch_sub(type(1));} |
| 8522 | _LIBCPP_INLINE_VISIBILITY |
| 8523 | long operator--(int) |
| 8524 | {typedef long long type; return fetch_sub(type(1));} |
| 8525 | _LIBCPP_INLINE_VISIBILITY |
| 8526 | long operator++() volatile |
| 8527 | {typedef long long type; return type(fetch_add(type(1)) + 1);} |
| 8528 | _LIBCPP_INLINE_VISIBILITY |
| 8529 | long operator++() |
| 8530 | {typedef long long type; return type(fetch_add(type(1)) + 1);} |
| 8531 | _LIBCPP_INLINE_VISIBILITY |
| 8532 | long operator--() volatile |
| 8533 | {typedef long long type; return type(fetch_sub(type(1)) - 1);} |
| 8534 | _LIBCPP_INLINE_VISIBILITY |
| 8535 | long operator--() |
| 8536 | {typedef long long type; return type(fetch_sub(type(1)) - 1);} |
| 8537 | _LIBCPP_INLINE_VISIBILITY |
| 8538 | long operator+=(long __v) volatile |
| 8539 | {typedef long long type; return type(fetch_add(__v) + __v);} |
| 8540 | _LIBCPP_INLINE_VISIBILITY |
| 8541 | long operator+=(long __v) |
| 8542 | {typedef long long type; return type(fetch_add(__v) + __v);} |
| 8543 | _LIBCPP_INLINE_VISIBILITY |
| 8544 | long operator-=(long __v) volatile |
| 8545 | {typedef long long type; return type(fetch_sub(__v) - __v);} |
| 8546 | _LIBCPP_INLINE_VISIBILITY |
| 8547 | long operator-=(long __v) |
| 8548 | {typedef long long type; return type(fetch_sub(__v) - __v);} |
| 8549 | _LIBCPP_INLINE_VISIBILITY |
| 8550 | long operator&=(long __v) volatile |
| 8551 | {typedef long long type; return type(fetch_and(__v) & __v);} |
| 8552 | _LIBCPP_INLINE_VISIBILITY |
| 8553 | long operator&=(long __v) |
| 8554 | {typedef long long type; return type(fetch_and(__v) & __v);} |
| 8555 | _LIBCPP_INLINE_VISIBILITY |
| 8556 | long operator|=(long __v) volatile |
| 8557 | {typedef long long type; return type(fetch_or(__v) | __v);} |
| 8558 | _LIBCPP_INLINE_VISIBILITY |
| 8559 | long operator|=(long __v) |
| 8560 | {typedef long long type; return type(fetch_or(__v) | __v);} |
| 8561 | _LIBCPP_INLINE_VISIBILITY |
| 8562 | long operator^=(long __v) volatile |
| 8563 | {typedef long long type; return type(fetch_xor(__v) ^ __v);} |
| 8564 | _LIBCPP_INLINE_VISIBILITY |
| 8565 | long operator^=(long __v) |
| 8566 | {typedef long long type; return type(fetch_xor(__v) ^ __v);} |
| 8567 | } atomic_llong; |
| 8568 | |
| 8569 | inline _LIBCPP_INLINE_VISIBILITY |
| 8570 | bool |
| 8571 | atomic_is_lock_free(const volatile atomic_llong*) |
| 8572 | { |
| 8573 | typedef long long type; |
| 8574 | return __atomic_is_lock_free(type); |
| 8575 | } |
| 8576 | |
| 8577 | inline _LIBCPP_INLINE_VISIBILITY |
| 8578 | bool |
| 8579 | atomic_is_lock_free(const atomic_llong* __obj) |
| 8580 | { |
| 8581 | return atomic_is_lock_free(const_cast<volatile atomic_llong*>(__obj)); |
| 8582 | } |
| 8583 | |
| 8584 | inline _LIBCPP_INLINE_VISIBILITY |
| 8585 | void |
| 8586 | atomic_init(volatile atomic_llong* __obj, long long __desr) |
| 8587 | { |
| 8588 | __obj->__v_ = __desr; |
| 8589 | } |
| 8590 | |
| 8591 | inline _LIBCPP_INLINE_VISIBILITY |
| 8592 | void |
| 8593 | atomic_init(atomic_llong* __obj, long long __desr) |
| 8594 | { |
| 8595 | __obj->__v_ = __desr; |
| 8596 | } |
| 8597 | |
| 8598 | inline _LIBCPP_INLINE_VISIBILITY |
| 8599 | void |
| 8600 | atomic_store(volatile atomic_llong* __obj, long long __desr) |
| 8601 | { |
| 8602 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 8603 | } |
| 8604 | |
| 8605 | inline _LIBCPP_INLINE_VISIBILITY |
| 8606 | void |
| 8607 | atomic_store(atomic_llong* __obj, long long __desr) |
| 8608 | { |
| 8609 | atomic_store(const_cast<volatile atomic_llong*>(__obj), __desr); |
| 8610 | } |
| 8611 | |
| 8612 | inline _LIBCPP_INLINE_VISIBILITY |
| 8613 | void |
| 8614 | atomic_store_explicit(volatile atomic_llong* __obj, long long __desr, |
| 8615 | memory_order __o) |
| 8616 | { |
| 8617 | __atomic_store(&__obj->__v_, __desr, __o); |
| 8618 | } |
| 8619 | |
| 8620 | inline _LIBCPP_INLINE_VISIBILITY |
| 8621 | void |
| 8622 | atomic_store_explicit(atomic_llong* __obj, long long __desr, |
| 8623 | memory_order __o) |
| 8624 | { |
| 8625 | atomic_store_explicit(const_cast<volatile atomic_llong*>(__obj), __desr, |
| 8626 | __o); |
| 8627 | } |
| 8628 | |
| 8629 | inline _LIBCPP_INLINE_VISIBILITY |
| 8630 | long long |
| 8631 | atomic_load(const volatile atomic_llong* __obj) |
| 8632 | { |
| 8633 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 8634 | } |
| 8635 | |
| 8636 | inline _LIBCPP_INLINE_VISIBILITY |
| 8637 | long long |
| 8638 | atomic_load(const atomic_llong* __obj) |
| 8639 | { |
| 8640 | return atomic_load(const_cast<const volatile atomic_llong*>(__obj)); |
| 8641 | } |
| 8642 | |
| 8643 | inline _LIBCPP_INLINE_VISIBILITY |
| 8644 | long long |
| 8645 | atomic_load_explicit(const volatile atomic_llong* __obj, memory_order __o) |
| 8646 | { |
| 8647 | return __atomic_load(&__obj->__v_, __o); |
| 8648 | } |
| 8649 | |
| 8650 | inline _LIBCPP_INLINE_VISIBILITY |
| 8651 | long long |
| 8652 | atomic_load_explicit(const atomic_llong* __obj, memory_order __o) |
| 8653 | { |
| 8654 | return atomic_load_explicit(const_cast<const volatile atomic_llong*> |
| 8655 | (__obj), __o); |
| 8656 | } |
| 8657 | |
| 8658 | inline _LIBCPP_INLINE_VISIBILITY |
| 8659 | long long |
| 8660 | atomic_exchange(volatile atomic_llong* __obj, long long __desr) |
| 8661 | { |
| 8662 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 8663 | } |
| 8664 | |
| 8665 | inline _LIBCPP_INLINE_VISIBILITY |
| 8666 | long long |
| 8667 | atomic_exchange(atomic_llong* __obj, long long __desr) |
| 8668 | { |
| 8669 | return atomic_exchange(const_cast<volatile atomic_llong*>(__obj), __desr); |
| 8670 | } |
| 8671 | |
| 8672 | inline _LIBCPP_INLINE_VISIBILITY |
| 8673 | long long |
| 8674 | atomic_exchange_explicit(volatile atomic_llong* __obj, long long __desr, |
| 8675 | memory_order __o) |
| 8676 | { |
| 8677 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 8678 | } |
| 8679 | |
| 8680 | inline _LIBCPP_INLINE_VISIBILITY |
| 8681 | long long |
| 8682 | atomic_exchange_explicit(atomic_llong* __obj, long long __desr, |
| 8683 | memory_order __o) |
| 8684 | { |
| 8685 | return atomic_exchange_explicit(const_cast<volatile atomic_llong*> |
| 8686 | (__obj), __desr, __o); |
| 8687 | } |
| 8688 | |
| 8689 | inline _LIBCPP_INLINE_VISIBILITY |
| 8690 | bool |
| 8691 | atomic_compare_exchange_weak(volatile atomic_llong* __obj, long long* __exp, |
| 8692 | long long __desr) |
| 8693 | { |
| 8694 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 8695 | memory_order_seq_cst, memory_order_seq_cst); |
| 8696 | } |
| 8697 | |
| 8698 | inline _LIBCPP_INLINE_VISIBILITY |
| 8699 | bool |
| 8700 | atomic_compare_exchange_weak(atomic_llong* __obj, long long* __exp, |
| 8701 | long long __desr) |
| 8702 | { |
| 8703 | return atomic_compare_exchange_weak(const_cast<volatile atomic_llong*> |
| 8704 | (__obj), __exp, __desr); |
| 8705 | } |
| 8706 | |
| 8707 | inline _LIBCPP_INLINE_VISIBILITY |
| 8708 | bool |
| 8709 | atomic_compare_exchange_strong(volatile atomic_llong* __obj, |
| 8710 | long long* __exp, long long __desr) |
| 8711 | { |
| 8712 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 8713 | memory_order_seq_cst, memory_order_seq_cst); |
| 8714 | } |
| 8715 | |
| 8716 | inline _LIBCPP_INLINE_VISIBILITY |
| 8717 | bool |
| 8718 | atomic_compare_exchange_strong(atomic_llong* __obj, long long* __exp, |
| 8719 | long long __desr) |
| 8720 | { |
| 8721 | return atomic_compare_exchange_strong(const_cast<volatile atomic_llong*> |
| 8722 | (__obj), __exp, __desr); |
| 8723 | } |
| 8724 | |
| 8725 | inline _LIBCPP_INLINE_VISIBILITY |
| 8726 | bool |
| 8727 | atomic_compare_exchange_weak_explicit(volatile atomic_llong* __obj, |
| 8728 | long long* __exp, |
| 8729 | long long __desr, memory_order __s, |
| 8730 | memory_order __f) |
| 8731 | { |
| 8732 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 8733 | __f); |
| 8734 | } |
| 8735 | |
| 8736 | inline _LIBCPP_INLINE_VISIBILITY |
| 8737 | bool |
| 8738 | atomic_compare_exchange_weak_explicit(atomic_llong* __obj, long long* __exp, |
| 8739 | long long __desr, memory_order __s, |
| 8740 | memory_order __f) |
| 8741 | { |
| 8742 | return atomic_compare_exchange_weak_explicit( |
| 8743 | const_cast<volatile atomic_llong*>(__obj), __exp, __desr, __s, __f); |
| 8744 | } |
| 8745 | |
| 8746 | inline _LIBCPP_INLINE_VISIBILITY |
| 8747 | bool |
| 8748 | atomic_compare_exchange_strong_explicit(volatile atomic_llong* __obj, |
| 8749 | long long* __exp, |
| 8750 | long long __desr, memory_order __s, |
| 8751 | memory_order __f) |
| 8752 | { |
| 8753 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 8754 | __f); |
| 8755 | } |
| 8756 | |
| 8757 | inline _LIBCPP_INLINE_VISIBILITY |
| 8758 | bool |
| 8759 | atomic_compare_exchange_strong_explicit(atomic_llong* __obj, |
| 8760 | long long* __exp, |
| 8761 | long long __desr, memory_order __s, |
| 8762 | memory_order __f) |
| 8763 | { |
| 8764 | return atomic_compare_exchange_strong_explicit( |
| 8765 | const_cast<volatile atomic_llong*>(__obj), __exp, __desr, __s, __f); |
| 8766 | } |
| 8767 | |
| 8768 | inline _LIBCPP_INLINE_VISIBILITY |
| 8769 | long long |
| 8770 | atomic_fetch_add(volatile atomic_llong* __obj, long long __v) |
| 8771 | { |
| 8772 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 8773 | } |
| 8774 | |
| 8775 | inline _LIBCPP_INLINE_VISIBILITY |
| 8776 | long long |
| 8777 | atomic_fetch_add(atomic_llong* __obj, long long __v) |
| 8778 | { |
| 8779 | return atomic_fetch_add(const_cast<volatile atomic_llong*>(__obj), __v); |
| 8780 | } |
| 8781 | |
| 8782 | inline _LIBCPP_INLINE_VISIBILITY |
| 8783 | long long |
| 8784 | atomic_fetch_add_explicit(volatile atomic_llong* __obj, long long __v, |
| 8785 | memory_order __o) |
| 8786 | { |
| 8787 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 8788 | } |
| 8789 | |
| 8790 | inline _LIBCPP_INLINE_VISIBILITY |
| 8791 | long long |
| 8792 | atomic_fetch_add_explicit(atomic_llong* __obj, long long __v, |
| 8793 | memory_order __o) |
| 8794 | { |
| 8795 | return atomic_fetch_add_explicit(const_cast<volatile atomic_llong*>(__obj), |
| 8796 | __v, __o); |
| 8797 | } |
| 8798 | |
| 8799 | inline _LIBCPP_INLINE_VISIBILITY |
| 8800 | long long |
| 8801 | atomic_fetch_sub(volatile atomic_llong* __obj, long long __v) |
| 8802 | { |
| 8803 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 8804 | } |
| 8805 | |
| 8806 | inline _LIBCPP_INLINE_VISIBILITY |
| 8807 | long long |
| 8808 | atomic_fetch_sub(atomic_llong* __obj, long long __v) |
| 8809 | { |
| 8810 | return atomic_fetch_sub(const_cast<volatile atomic_llong*>(__obj), __v); |
| 8811 | } |
| 8812 | |
| 8813 | inline _LIBCPP_INLINE_VISIBILITY |
| 8814 | long long |
| 8815 | atomic_fetch_sub_explicit(volatile atomic_llong* __obj, long long __v, |
| 8816 | memory_order __o) |
| 8817 | { |
| 8818 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 8819 | } |
| 8820 | |
| 8821 | inline _LIBCPP_INLINE_VISIBILITY |
| 8822 | long long |
| 8823 | atomic_fetch_sub_explicit(atomic_llong* __obj, long long __v, |
| 8824 | memory_order __o) |
| 8825 | { |
| 8826 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_llong*>(__obj), |
| 8827 | __v, __o); |
| 8828 | } |
| 8829 | |
| 8830 | inline _LIBCPP_INLINE_VISIBILITY |
| 8831 | long long |
| 8832 | atomic_fetch_and(volatile atomic_llong* __obj, long long __v) |
| 8833 | { |
| 8834 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 8835 | } |
| 8836 | |
| 8837 | inline _LIBCPP_INLINE_VISIBILITY |
| 8838 | long long |
| 8839 | atomic_fetch_and(atomic_llong* __obj, long long __v) |
| 8840 | { |
| 8841 | return atomic_fetch_and(const_cast<volatile atomic_llong*>(__obj), __v); |
| 8842 | } |
| 8843 | |
| 8844 | inline _LIBCPP_INLINE_VISIBILITY |
| 8845 | long long |
| 8846 | atomic_fetch_and_explicit(volatile atomic_llong* __obj, long long __v, |
| 8847 | memory_order __o) |
| 8848 | { |
| 8849 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 8850 | } |
| 8851 | |
| 8852 | inline _LIBCPP_INLINE_VISIBILITY |
| 8853 | long long |
| 8854 | atomic_fetch_and_explicit(atomic_llong* __obj, long long __v, |
| 8855 | memory_order __o) |
| 8856 | { |
| 8857 | return atomic_fetch_and_explicit(const_cast<volatile atomic_llong*>(__obj), |
| 8858 | __v, __o); |
| 8859 | } |
| 8860 | |
| 8861 | inline _LIBCPP_INLINE_VISIBILITY |
| 8862 | long long |
| 8863 | atomic_fetch_or(volatile atomic_llong* __obj, long long __v) |
| 8864 | { |
| 8865 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 8866 | } |
| 8867 | |
| 8868 | inline _LIBCPP_INLINE_VISIBILITY |
| 8869 | long long |
| 8870 | atomic_fetch_or(atomic_llong* __obj, long long __v) |
| 8871 | { |
| 8872 | return atomic_fetch_or(const_cast<volatile atomic_llong*>(__obj), __v); |
| 8873 | } |
| 8874 | |
| 8875 | inline _LIBCPP_INLINE_VISIBILITY |
| 8876 | long long |
| 8877 | atomic_fetch_or_explicit(volatile atomic_llong* __obj, long long __v, |
| 8878 | memory_order __o) |
| 8879 | { |
| 8880 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 8881 | } |
| 8882 | |
| 8883 | inline _LIBCPP_INLINE_VISIBILITY |
| 8884 | long long |
| 8885 | atomic_fetch_or_explicit(atomic_llong* __obj, long long __v, |
| 8886 | memory_order __o) |
| 8887 | { |
| 8888 | return atomic_fetch_or_explicit(const_cast<volatile atomic_llong*>(__obj), |
| 8889 | __v, __o); |
| 8890 | } |
| 8891 | |
| 8892 | inline _LIBCPP_INLINE_VISIBILITY |
| 8893 | long long |
| 8894 | atomic_fetch_xor(volatile atomic_llong* __obj, long long __v) |
| 8895 | { |
| 8896 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 8897 | } |
| 8898 | |
| 8899 | inline _LIBCPP_INLINE_VISIBILITY |
| 8900 | long long |
| 8901 | atomic_fetch_xor(atomic_llong* __obj, long long __v) |
| 8902 | { |
| 8903 | return atomic_fetch_xor(const_cast<volatile atomic_llong*>(__obj), __v); |
| 8904 | } |
| 8905 | |
| 8906 | inline _LIBCPP_INLINE_VISIBILITY |
| 8907 | long long |
| 8908 | atomic_fetch_xor_explicit(volatile atomic_llong* __obj, long long __v, |
| 8909 | memory_order __o) |
| 8910 | { |
| 8911 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 8912 | } |
| 8913 | |
| 8914 | inline _LIBCPP_INLINE_VISIBILITY |
| 8915 | long long |
| 8916 | atomic_fetch_xor_explicit(atomic_llong* __obj, long long __v, |
| 8917 | memory_order __o) |
| 8918 | { |
| 8919 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_llong*>(__obj), |
| 8920 | __v, __o); |
| 8921 | } |
| 8922 | |
| 8923 | // atomic_ullong |
| 8924 | |
| 8925 | struct atomic_ullong; |
| 8926 | |
| 8927 | bool atomic_is_lock_free(const volatile atomic_ullong*); |
| 8928 | bool atomic_is_lock_free(const atomic_ullong*); |
| 8929 | void atomic_init(volatile atomic_ullong*, unsigned long long); |
| 8930 | void atomic_init(atomic_ullong*, unsigned long long); |
| 8931 | void atomic_store(volatile atomic_ullong*, unsigned long long); |
| 8932 | void atomic_store(atomic_ullong*, unsigned long long); |
| 8933 | void atomic_store_explicit(volatile atomic_ullong*, unsigned long long, |
| 8934 | memory_order); |
| 8935 | void atomic_store_explicit(atomic_ullong*, unsigned long long, memory_order); |
| 8936 | unsigned long long atomic_load(const volatile atomic_ullong*); |
| 8937 | unsigned long long atomic_load(const atomic_ullong*); |
| 8938 | unsigned long long atomic_load_explicit(const volatile atomic_ullong*, |
| 8939 | memory_order); |
| 8940 | unsigned long long atomic_load_explicit(const atomic_ullong*, memory_order); |
| 8941 | unsigned long long atomic_exchange(volatile atomic_ullong*, unsigned long long); |
| 8942 | unsigned long long atomic_exchange(atomic_ullong*, unsigned long long); |
| 8943 | unsigned long long atomic_exchange_explicit(volatile atomic_ullong*, |
| 8944 | unsigned long long, memory_order); |
| 8945 | unsigned long long atomic_exchange_explicit(atomic_ullong*, unsigned long long, |
| 8946 | memory_order); |
| 8947 | bool atomic_compare_exchange_weak(volatile atomic_ullong*, unsigned long long*, |
| 8948 | unsigned long long); |
| 8949 | bool atomic_compare_exchange_weak(atomic_ullong*, unsigned long long*, |
| 8950 | unsigned long long); |
| 8951 | bool atomic_compare_exchange_strong(volatile atomic_ullong*, |
| 8952 | unsigned long long*, unsigned long long); |
| 8953 | bool atomic_compare_exchange_strong(atomic_ullong*, unsigned long long*, |
| 8954 | unsigned long long); |
| 8955 | bool atomic_compare_exchange_weak_explicit(volatile atomic_ullong*, |
| 8956 | unsigned long long*, |
| 8957 | unsigned long long, |
| 8958 | memory_order, memory_order); |
| 8959 | bool atomic_compare_exchange_weak_explicit(atomic_ullong*, unsigned long long*, |
| 8960 | unsigned long long, memory_order, |
| 8961 | memory_order); |
| 8962 | bool atomic_compare_exchange_strong_explicit(volatile atomic_ullong*, |
| 8963 | unsigned long long*, |
| 8964 | unsigned long long, |
| 8965 | memory_order, memory_order); |
| 8966 | bool atomic_compare_exchange_strong_explicit(atomic_ullong*, |
| 8967 | unsigned long long*, |
| 8968 | unsigned long long, memory_order, |
| 8969 | memory_order); |
| 8970 | unsigned long long atomic_fetch_add(volatile atomic_ullong*, |
| 8971 | unsigned long long); |
| 8972 | unsigned long long atomic_fetch_add(atomic_ullong*, unsigned long long); |
| 8973 | unsigned long long atomic_fetch_add_explicit(volatile atomic_ullong*, |
| 8974 | unsigned long long, memory_order); |
| 8975 | unsigned long long atomic_fetch_add_explicit(atomic_ullong*, unsigned long long, |
| 8976 | memory_order); |
| 8977 | unsigned long long atomic_fetch_sub(volatile atomic_ullong*, |
| 8978 | unsigned long long); |
| 8979 | unsigned long long atomic_fetch_sub(atomic_ullong*, unsigned long long); |
| 8980 | unsigned long long atomic_fetch_sub_explicit(volatile atomic_ullong*, |
| 8981 | unsigned long long, memory_order); |
| 8982 | unsigned long long atomic_fetch_sub_explicit(atomic_ullong*, unsigned long long, |
| 8983 | memory_order); |
| 8984 | unsigned long long atomic_fetch_and(volatile atomic_ullong*, unsigned long long); |
| 8985 | unsigned long long atomic_fetch_and(atomic_ullong*, unsigned long long); |
| 8986 | unsigned long long atomic_fetch_and_explicit(volatile atomic_ullong*, |
| 8987 | unsigned long long, memory_order); |
| 8988 | unsigned long long atomic_fetch_and_explicit(atomic_ullong*, unsigned long long, |
| 8989 | memory_order); |
| 8990 | unsigned long long atomic_fetch_or(volatile atomic_ullong*, unsigned long long); |
| 8991 | unsigned long long atomic_fetch_or(atomic_ullong*, unsigned long long); |
| 8992 | unsigned long long atomic_fetch_or_explicit(volatile atomic_ullong*, |
| 8993 | unsigned long long, memory_order); |
| 8994 | unsigned long long atomic_fetch_or_explicit(atomic_ullong*, unsigned long long, |
| 8995 | memory_order); |
| 8996 | unsigned long long atomic_fetch_xor(volatile atomic_ullong*, |
| 8997 | unsigned long long); |
| 8998 | unsigned long long atomic_fetch_xor(atomic_ullong*, unsigned long long); |
| 8999 | unsigned long long atomic_fetch_xor_explicit(volatile atomic_ullong*, |
| 9000 | unsigned long long, memory_order); |
| 9001 | unsigned long long atomic_fetch_xor_explicit(atomic_ullong*, unsigned long long, |
| 9002 | memory_order); |
| 9003 | |
| 9004 | typedef struct atomic_ullong |
| 9005 | { |
| 9006 | unsigned long long __v_; |
| 9007 | |
| 9008 | _LIBCPP_INLINE_VISIBILITY |
| 9009 | bool is_lock_free() const volatile |
| 9010 | {return atomic_is_lock_free(this);} |
| 9011 | _LIBCPP_INLINE_VISIBILITY |
| 9012 | bool is_lock_free() const |
| 9013 | {return atomic_is_lock_free(this);} |
| 9014 | _LIBCPP_INLINE_VISIBILITY |
| 9015 | void store(unsigned long long __v, |
| 9016 | memory_order __o = memory_order_seq_cst) volatile |
| 9017 | {atomic_store_explicit(this, __v, __o);} |
| 9018 | _LIBCPP_INLINE_VISIBILITY |
| 9019 | void store(unsigned long long __v, memory_order __o = memory_order_seq_cst) |
| 9020 | {atomic_store_explicit(this, __v, __o);} |
| 9021 | _LIBCPP_INLINE_VISIBILITY |
| 9022 | unsigned long long load(memory_order __o = memory_order_seq_cst) const |
| 9023 | volatile |
| 9024 | {return atomic_load_explicit(this, __o);} |
| 9025 | _LIBCPP_INLINE_VISIBILITY |
| 9026 | unsigned long long load(memory_order __o = memory_order_seq_cst) const |
| 9027 | {return atomic_load_explicit(this, __o);} |
| 9028 | _LIBCPP_INLINE_VISIBILITY |
| 9029 | operator unsigned long long() const volatile |
| 9030 | {return load();} |
| 9031 | _LIBCPP_INLINE_VISIBILITY |
| 9032 | operator unsigned long long() const |
| 9033 | {return load();} |
| 9034 | _LIBCPP_INLINE_VISIBILITY |
| 9035 | unsigned long long exchange(unsigned long long __v, |
| 9036 | memory_order __o = memory_order_seq_cst) volatile |
| 9037 | {return atomic_exchange_explicit(this, __v, __o);} |
| 9038 | _LIBCPP_INLINE_VISIBILITY |
| 9039 | unsigned long long exchange(unsigned long long __v, |
| 9040 | memory_order __o = memory_order_seq_cst) |
| 9041 | {return atomic_exchange_explicit(this, __v, __o);} |
| 9042 | _LIBCPP_INLINE_VISIBILITY |
| 9043 | bool compare_exchange_weak(unsigned long long& __v, unsigned long long __e, |
| 9044 | memory_order __s, memory_order __f) volatile |
| 9045 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9046 | __f);} |
| 9047 | _LIBCPP_INLINE_VISIBILITY |
| 9048 | bool compare_exchange_weak(unsigned long long& __v, unsigned long long __e, |
| 9049 | memory_order __s, memory_order __f) |
| 9050 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9051 | __f);} |
| 9052 | _LIBCPP_INLINE_VISIBILITY |
| 9053 | bool compare_exchange_strong(unsigned long long& __v, unsigned long long __e, |
| 9054 | memory_order __s, memory_order __f) volatile |
| 9055 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9056 | __f);} |
| 9057 | _LIBCPP_INLINE_VISIBILITY |
| 9058 | bool compare_exchange_strong(unsigned long long& __v, unsigned long long __e, |
| 9059 | memory_order __s, memory_order __f) |
| 9060 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9061 | __f);} |
| 9062 | _LIBCPP_INLINE_VISIBILITY |
| 9063 | bool compare_exchange_weak(unsigned long long& __v, unsigned long long __e, |
| 9064 | memory_order __s = memory_order_seq_cst) volatile |
| 9065 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9066 | __translate_memory_order(__s));} |
| 9067 | _LIBCPP_INLINE_VISIBILITY |
| 9068 | bool compare_exchange_weak(unsigned long long& __v, unsigned long long __e, |
| 9069 | memory_order __s = memory_order_seq_cst) |
| 9070 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9071 | __translate_memory_order(__s));} |
| 9072 | _LIBCPP_INLINE_VISIBILITY |
| 9073 | bool compare_exchange_strong(unsigned long long& __v, unsigned long long __e, |
| 9074 | memory_order __s = memory_order_seq_cst) volatile |
| 9075 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9076 | __translate_memory_order(__s));} |
| 9077 | _LIBCPP_INLINE_VISIBILITY |
| 9078 | bool compare_exchange_strong(unsigned long long& __v, unsigned long long __e, |
| 9079 | memory_order __s = memory_order_seq_cst) |
| 9080 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9081 | __translate_memory_order(__s));} |
| 9082 | _LIBCPP_INLINE_VISIBILITY |
| 9083 | unsigned long long fetch_add(unsigned long long __v, |
| 9084 | memory_order __o = memory_order_seq_cst) volatile |
| 9085 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 9086 | _LIBCPP_INLINE_VISIBILITY |
| 9087 | unsigned long long fetch_add(unsigned long long __v, |
| 9088 | memory_order __o = memory_order_seq_cst) |
| 9089 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 9090 | _LIBCPP_INLINE_VISIBILITY |
| 9091 | unsigned long long fetch_sub(unsigned long long __v, |
| 9092 | memory_order __o = memory_order_seq_cst) volatile |
| 9093 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 9094 | _LIBCPP_INLINE_VISIBILITY |
| 9095 | unsigned long long fetch_sub(unsigned long long __v, |
| 9096 | memory_order __o = memory_order_seq_cst) |
| 9097 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 9098 | _LIBCPP_INLINE_VISIBILITY |
| 9099 | unsigned long long fetch_and(unsigned long long __v, |
| 9100 | memory_order __o = memory_order_seq_cst) volatile |
| 9101 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 9102 | _LIBCPP_INLINE_VISIBILITY |
| 9103 | unsigned long long fetch_and(unsigned long long __v, |
| 9104 | memory_order __o = memory_order_seq_cst) |
| 9105 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 9106 | _LIBCPP_INLINE_VISIBILITY |
| 9107 | unsigned long long fetch_or(unsigned long long __v, |
| 9108 | memory_order __o = memory_order_seq_cst) volatile |
| 9109 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 9110 | _LIBCPP_INLINE_VISIBILITY |
| 9111 | unsigned long long fetch_or(unsigned long long __v, |
| 9112 | memory_order __o = memory_order_seq_cst) |
| 9113 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 9114 | _LIBCPP_INLINE_VISIBILITY |
| 9115 | unsigned long long fetch_xor(unsigned long long __v, |
| 9116 | memory_order __o = memory_order_seq_cst) volatile |
| 9117 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 9118 | _LIBCPP_INLINE_VISIBILITY |
| 9119 | unsigned long long fetch_xor(unsigned long long __v, |
| 9120 | memory_order __o = memory_order_seq_cst) |
| 9121 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 9122 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 9123 | atomic_ullong() = default; |
| 9124 | #else |
| 9125 | _LIBCPP_INLINE_VISIBILITY |
| 9126 | atomic_ullong() {} |
| 9127 | #endif |
| 9128 | _LIBCPP_INLINE_VISIBILITY |
| 9129 | /*constexpr*/ atomic_ullong(unsigned long long __v) |
| 9130 | : __v_(__v) {} |
| 9131 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 9132 | atomic_ullong(const atomic_ullong&) = delete; |
| 9133 | atomic_ullong& operator=(const atomic_ullong&) = delete; |
| 9134 | atomic_ullong& operator=(const atomic_ullong&) volatile = delete; |
| 9135 | #else |
| 9136 | private: |
| 9137 | atomic_ullong(const atomic_ullong&); |
| 9138 | atomic_ullong& operator=(const atomic_ullong&); |
| 9139 | atomic_ullong& operator=(const atomic_ullong&) volatile; |
| 9140 | public: |
| 9141 | #endif |
| 9142 | _LIBCPP_INLINE_VISIBILITY |
| 9143 | unsigned long long operator=(unsigned long long __v) volatile |
| 9144 | {store(__v); return __v;} |
| 9145 | _LIBCPP_INLINE_VISIBILITY |
| 9146 | unsigned long long operator=(unsigned long long __v) |
| 9147 | {store(__v); return __v;} |
| 9148 | _LIBCPP_INLINE_VISIBILITY |
| 9149 | unsigned long long operator++(int) volatile |
| 9150 | {typedef unsigned long long type; return fetch_add(type(1));} |
| 9151 | _LIBCPP_INLINE_VISIBILITY |
| 9152 | long operator++(int) |
| 9153 | {typedef unsigned long long type; return fetch_add(type(1));} |
| 9154 | _LIBCPP_INLINE_VISIBILITY |
| 9155 | long operator--(int) volatile |
| 9156 | {typedef unsigned long long type; return fetch_sub(type(1));} |
| 9157 | _LIBCPP_INLINE_VISIBILITY |
| 9158 | long operator--(int) |
| 9159 | {typedef unsigned long long type; return fetch_sub(type(1));} |
| 9160 | _LIBCPP_INLINE_VISIBILITY |
| 9161 | long operator++() volatile |
| 9162 | {typedef unsigned long long type; return type(fetch_add(type(1)) + 1);} |
| 9163 | _LIBCPP_INLINE_VISIBILITY |
| 9164 | long operator++() |
| 9165 | {typedef unsigned long long type; return type(fetch_add(type(1)) + 1);} |
| 9166 | _LIBCPP_INLINE_VISIBILITY |
| 9167 | long operator--() volatile |
| 9168 | {typedef unsigned long long type; return type(fetch_sub(type(1)) - 1);} |
| 9169 | _LIBCPP_INLINE_VISIBILITY |
| 9170 | long operator--() |
| 9171 | {typedef unsigned long long type; return type(fetch_sub(type(1)) - 1);} |
| 9172 | _LIBCPP_INLINE_VISIBILITY |
| 9173 | long operator+=(long __v) volatile |
| 9174 | {typedef unsigned long long type; return type(fetch_add(__v) + __v);} |
| 9175 | _LIBCPP_INLINE_VISIBILITY |
| 9176 | long operator+=(long __v) |
| 9177 | {typedef unsigned long long type; return type(fetch_add(__v) + __v);} |
| 9178 | _LIBCPP_INLINE_VISIBILITY |
| 9179 | long operator-=(long __v) volatile |
| 9180 | {typedef unsigned long long type; return type(fetch_sub(__v) - __v);} |
| 9181 | _LIBCPP_INLINE_VISIBILITY |
| 9182 | long operator-=(long __v) |
| 9183 | {typedef unsigned long long type; return type(fetch_sub(__v) - __v);} |
| 9184 | _LIBCPP_INLINE_VISIBILITY |
| 9185 | long operator&=(long __v) volatile |
| 9186 | {typedef unsigned long long type; return type(fetch_and(__v) & __v);} |
| 9187 | _LIBCPP_INLINE_VISIBILITY |
| 9188 | long operator&=(long __v) |
| 9189 | {typedef unsigned long long type; return type(fetch_and(__v) & __v);} |
| 9190 | _LIBCPP_INLINE_VISIBILITY |
| 9191 | long operator|=(long __v) volatile |
| 9192 | {typedef unsigned long long type; return type(fetch_or(__v) | __v);} |
| 9193 | _LIBCPP_INLINE_VISIBILITY |
| 9194 | long operator|=(long __v) |
| 9195 | {typedef unsigned long long type; return type(fetch_or(__v) | __v);} |
| 9196 | _LIBCPP_INLINE_VISIBILITY |
| 9197 | long operator^=(long __v) volatile |
| 9198 | {typedef unsigned long long type; return type(fetch_xor(__v) ^ __v);} |
| 9199 | _LIBCPP_INLINE_VISIBILITY |
| 9200 | long operator^=(long __v) |
| 9201 | {typedef unsigned long long type; return type(fetch_xor(__v) ^ __v);} |
| 9202 | } atomic_ullong; |
| 9203 | |
| 9204 | inline _LIBCPP_INLINE_VISIBILITY |
| 9205 | bool |
| 9206 | atomic_is_lock_free(const volatile atomic_ullong*) |
| 9207 | { |
| 9208 | typedef unsigned long long type; |
| 9209 | return __atomic_is_lock_free(type); |
| 9210 | } |
| 9211 | |
| 9212 | inline _LIBCPP_INLINE_VISIBILITY |
| 9213 | bool |
| 9214 | atomic_is_lock_free(const atomic_ullong* __obj) |
| 9215 | { |
| 9216 | return atomic_is_lock_free(const_cast<volatile atomic_ullong*>(__obj)); |
| 9217 | } |
| 9218 | |
| 9219 | inline _LIBCPP_INLINE_VISIBILITY |
| 9220 | void |
| 9221 | atomic_init(volatile atomic_ullong* __obj, unsigned long long __desr) |
| 9222 | { |
| 9223 | __obj->__v_ = __desr; |
| 9224 | } |
| 9225 | |
| 9226 | inline _LIBCPP_INLINE_VISIBILITY |
| 9227 | void |
| 9228 | atomic_init(atomic_ullong* __obj, unsigned long long __desr) |
| 9229 | { |
| 9230 | __obj->__v_ = __desr; |
| 9231 | } |
| 9232 | |
| 9233 | inline _LIBCPP_INLINE_VISIBILITY |
| 9234 | void |
| 9235 | atomic_store(volatile atomic_ullong* __obj, unsigned long long __desr) |
| 9236 | { |
| 9237 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 9238 | } |
| 9239 | |
| 9240 | inline _LIBCPP_INLINE_VISIBILITY |
| 9241 | void |
| 9242 | atomic_store(atomic_ullong* __obj, unsigned long long __desr) |
| 9243 | { |
| 9244 | atomic_store(const_cast<volatile atomic_ullong*>(__obj), __desr); |
| 9245 | } |
| 9246 | |
| 9247 | inline _LIBCPP_INLINE_VISIBILITY |
| 9248 | void |
| 9249 | atomic_store_explicit(volatile atomic_ullong* __obj, unsigned long long __desr, |
| 9250 | memory_order __o) |
| 9251 | { |
| 9252 | __atomic_store(&__obj->__v_, __desr, __o); |
| 9253 | } |
| 9254 | |
| 9255 | inline _LIBCPP_INLINE_VISIBILITY |
| 9256 | void |
| 9257 | atomic_store_explicit(atomic_ullong* __obj, unsigned long long __desr, |
| 9258 | memory_order __o) |
| 9259 | { |
| 9260 | atomic_store_explicit(const_cast<volatile atomic_ullong*>(__obj), __desr, |
| 9261 | __o); |
| 9262 | } |
| 9263 | |
| 9264 | inline _LIBCPP_INLINE_VISIBILITY |
| 9265 | unsigned long long |
| 9266 | atomic_load(const volatile atomic_ullong* __obj) |
| 9267 | { |
| 9268 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 9269 | } |
| 9270 | |
| 9271 | inline _LIBCPP_INLINE_VISIBILITY |
| 9272 | unsigned long long |
| 9273 | atomic_load(const atomic_ullong* __obj) |
| 9274 | { |
| 9275 | return atomic_load(const_cast<const volatile atomic_ullong*>(__obj)); |
| 9276 | } |
| 9277 | |
| 9278 | inline _LIBCPP_INLINE_VISIBILITY |
| 9279 | unsigned long long |
| 9280 | atomic_load_explicit(const volatile atomic_ullong* __obj, memory_order __o) |
| 9281 | { |
| 9282 | return __atomic_load(&__obj->__v_, __o); |
| 9283 | } |
| 9284 | |
| 9285 | inline _LIBCPP_INLINE_VISIBILITY |
| 9286 | unsigned long long |
| 9287 | atomic_load_explicit(const atomic_ullong* __obj, memory_order __o) |
| 9288 | { |
| 9289 | return atomic_load_explicit(const_cast<const volatile atomic_ullong*> |
| 9290 | (__obj), __o); |
| 9291 | } |
| 9292 | |
| 9293 | inline _LIBCPP_INLINE_VISIBILITY |
| 9294 | unsigned long long |
| 9295 | atomic_exchange(volatile atomic_ullong* __obj, unsigned long long __desr) |
| 9296 | { |
| 9297 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 9298 | } |
| 9299 | |
| 9300 | inline _LIBCPP_INLINE_VISIBILITY |
| 9301 | unsigned long long |
| 9302 | atomic_exchange(atomic_ullong* __obj, unsigned long long __desr) |
| 9303 | { |
| 9304 | return atomic_exchange(const_cast<volatile atomic_ullong*>(__obj), __desr); |
| 9305 | } |
| 9306 | |
| 9307 | inline _LIBCPP_INLINE_VISIBILITY |
| 9308 | unsigned long long |
| 9309 | atomic_exchange_explicit(volatile atomic_ullong* __obj, |
| 9310 | unsigned long long __desr, memory_order __o) |
| 9311 | { |
| 9312 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 9313 | } |
| 9314 | |
| 9315 | inline _LIBCPP_INLINE_VISIBILITY |
| 9316 | unsigned long long |
| 9317 | atomic_exchange_explicit(atomic_ullong* __obj, unsigned long long __desr, |
| 9318 | memory_order __o) |
| 9319 | { |
| 9320 | return atomic_exchange_explicit(const_cast<volatile atomic_ullong*> |
| 9321 | (__obj), __desr, __o); |
| 9322 | } |
| 9323 | |
| 9324 | inline _LIBCPP_INLINE_VISIBILITY |
| 9325 | bool |
| 9326 | atomic_compare_exchange_weak(volatile atomic_ullong* __obj, |
| 9327 | unsigned long long* __exp, |
| 9328 | unsigned long long __desr) |
| 9329 | { |
| 9330 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 9331 | memory_order_seq_cst, memory_order_seq_cst); |
| 9332 | } |
| 9333 | |
| 9334 | inline _LIBCPP_INLINE_VISIBILITY |
| 9335 | bool |
| 9336 | atomic_compare_exchange_weak(atomic_ullong* __obj, unsigned long long* __exp, |
| 9337 | unsigned long long __desr) |
| 9338 | { |
| 9339 | return atomic_compare_exchange_weak(const_cast<volatile atomic_ullong*> |
| 9340 | (__obj), __exp, __desr); |
| 9341 | } |
| 9342 | |
| 9343 | inline _LIBCPP_INLINE_VISIBILITY |
| 9344 | bool |
| 9345 | atomic_compare_exchange_strong(volatile atomic_ullong* __obj, |
| 9346 | unsigned long long* __exp, |
| 9347 | unsigned long long __desr) |
| 9348 | { |
| 9349 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 9350 | memory_order_seq_cst, memory_order_seq_cst); |
| 9351 | } |
| 9352 | |
| 9353 | inline _LIBCPP_INLINE_VISIBILITY |
| 9354 | bool |
| 9355 | atomic_compare_exchange_strong(atomic_ullong* __obj, unsigned long long* __exp, |
| 9356 | unsigned long long __desr) |
| 9357 | { |
| 9358 | return atomic_compare_exchange_strong(const_cast<volatile atomic_ullong*> |
| 9359 | (__obj), __exp, __desr); |
| 9360 | } |
| 9361 | |
| 9362 | inline _LIBCPP_INLINE_VISIBILITY |
| 9363 | bool |
| 9364 | atomic_compare_exchange_weak_explicit(volatile atomic_ullong* __obj, |
| 9365 | unsigned long long* __exp, |
| 9366 | unsigned long long __desr, |
| 9367 | memory_order __s, memory_order __f) |
| 9368 | { |
| 9369 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 9370 | __f); |
| 9371 | } |
| 9372 | |
| 9373 | inline _LIBCPP_INLINE_VISIBILITY |
| 9374 | bool |
| 9375 | atomic_compare_exchange_weak_explicit(atomic_ullong* __obj, |
| 9376 | unsigned long long* __exp, |
| 9377 | unsigned long long __desr, |
| 9378 | memory_order __s, memory_order __f) |
| 9379 | { |
| 9380 | return atomic_compare_exchange_weak_explicit( |
| 9381 | const_cast<volatile atomic_ullong*>(__obj), __exp, __desr, __s, __f); |
| 9382 | } |
| 9383 | |
| 9384 | inline _LIBCPP_INLINE_VISIBILITY |
| 9385 | bool |
| 9386 | atomic_compare_exchange_strong_explicit(volatile atomic_ullong* __obj, |
| 9387 | unsigned long long* __exp, |
| 9388 | unsigned long long __desr, |
| 9389 | memory_order __s, memory_order __f) |
| 9390 | { |
| 9391 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 9392 | __f); |
| 9393 | } |
| 9394 | |
| 9395 | inline _LIBCPP_INLINE_VISIBILITY |
| 9396 | bool |
| 9397 | atomic_compare_exchange_strong_explicit(atomic_ullong* __obj, |
| 9398 | unsigned long long* __exp, |
| 9399 | unsigned long long __desr, |
| 9400 | memory_order __s, memory_order __f) |
| 9401 | { |
| 9402 | return atomic_compare_exchange_strong_explicit( |
| 9403 | const_cast<volatile atomic_ullong*>(__obj), __exp, __desr, __s, __f); |
| 9404 | } |
| 9405 | |
| 9406 | inline _LIBCPP_INLINE_VISIBILITY |
| 9407 | unsigned long long |
| 9408 | atomic_fetch_add(volatile atomic_ullong* __obj, unsigned long long __v) |
| 9409 | { |
| 9410 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 9411 | } |
| 9412 | |
| 9413 | inline _LIBCPP_INLINE_VISIBILITY |
| 9414 | unsigned long long |
| 9415 | atomic_fetch_add(atomic_ullong* __obj, unsigned long long __v) |
| 9416 | { |
| 9417 | return atomic_fetch_add(const_cast<volatile atomic_ullong*>(__obj), __v); |
| 9418 | } |
| 9419 | |
| 9420 | inline _LIBCPP_INLINE_VISIBILITY |
| 9421 | unsigned long long |
| 9422 | atomic_fetch_add_explicit(volatile atomic_ullong* __obj, unsigned long long __v, |
| 9423 | memory_order __o) |
| 9424 | { |
| 9425 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 9426 | } |
| 9427 | |
| 9428 | inline _LIBCPP_INLINE_VISIBILITY |
| 9429 | unsigned long long |
| 9430 | atomic_fetch_add_explicit(atomic_ullong* __obj, unsigned long long __v, |
| 9431 | memory_order __o) |
| 9432 | { |
| 9433 | return atomic_fetch_add_explicit(const_cast<volatile atomic_ullong*>(__obj), |
| 9434 | __v, __o); |
| 9435 | } |
| 9436 | |
| 9437 | inline _LIBCPP_INLINE_VISIBILITY |
| 9438 | unsigned long long |
| 9439 | atomic_fetch_sub(volatile atomic_ullong* __obj, unsigned long long __v) |
| 9440 | { |
| 9441 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 9442 | } |
| 9443 | |
| 9444 | inline _LIBCPP_INLINE_VISIBILITY |
| 9445 | unsigned long long |
| 9446 | atomic_fetch_sub(atomic_ullong* __obj, unsigned long long __v) |
| 9447 | { |
| 9448 | return atomic_fetch_sub(const_cast<volatile atomic_ullong*>(__obj), __v); |
| 9449 | } |
| 9450 | |
| 9451 | inline _LIBCPP_INLINE_VISIBILITY |
| 9452 | unsigned long long |
| 9453 | atomic_fetch_sub_explicit(volatile atomic_ullong* __obj, unsigned long long __v, |
| 9454 | memory_order __o) |
| 9455 | { |
| 9456 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 9457 | } |
| 9458 | |
| 9459 | inline _LIBCPP_INLINE_VISIBILITY |
| 9460 | unsigned long long |
| 9461 | atomic_fetch_sub_explicit(atomic_ullong* __obj, unsigned long long __v, |
| 9462 | memory_order __o) |
| 9463 | { |
| 9464 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_ullong*>(__obj), |
| 9465 | __v, __o); |
| 9466 | } |
| 9467 | |
| 9468 | inline _LIBCPP_INLINE_VISIBILITY |
| 9469 | unsigned long long |
| 9470 | atomic_fetch_and(volatile atomic_ullong* __obj, unsigned long long __v) |
| 9471 | { |
| 9472 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 9473 | } |
| 9474 | |
| 9475 | inline _LIBCPP_INLINE_VISIBILITY |
| 9476 | unsigned long long |
| 9477 | atomic_fetch_and(atomic_ullong* __obj, unsigned long long __v) |
| 9478 | { |
| 9479 | return atomic_fetch_and(const_cast<volatile atomic_ullong*>(__obj), __v); |
| 9480 | } |
| 9481 | |
| 9482 | inline _LIBCPP_INLINE_VISIBILITY |
| 9483 | unsigned long long |
| 9484 | atomic_fetch_and_explicit(volatile atomic_ullong* __obj, unsigned long long __v, |
| 9485 | memory_order __o) |
| 9486 | { |
| 9487 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 9488 | } |
| 9489 | |
| 9490 | inline _LIBCPP_INLINE_VISIBILITY |
| 9491 | unsigned long long |
| 9492 | atomic_fetch_and_explicit(atomic_ullong* __obj, unsigned long long __v, |
| 9493 | memory_order __o) |
| 9494 | { |
| 9495 | return atomic_fetch_and_explicit(const_cast<volatile atomic_ullong*>(__obj), |
| 9496 | __v, __o); |
| 9497 | } |
| 9498 | |
| 9499 | inline _LIBCPP_INLINE_VISIBILITY |
| 9500 | unsigned long long |
| 9501 | atomic_fetch_or(volatile atomic_ullong* __obj, unsigned long long __v) |
| 9502 | { |
| 9503 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 9504 | } |
| 9505 | |
| 9506 | inline _LIBCPP_INLINE_VISIBILITY |
| 9507 | unsigned long long |
| 9508 | atomic_fetch_or(atomic_ullong* __obj, unsigned long long __v) |
| 9509 | { |
| 9510 | return atomic_fetch_or(const_cast<volatile atomic_ullong*>(__obj), __v); |
| 9511 | } |
| 9512 | |
| 9513 | inline _LIBCPP_INLINE_VISIBILITY |
| 9514 | unsigned long long |
| 9515 | atomic_fetch_or_explicit(volatile atomic_ullong* __obj, unsigned long long __v, |
| 9516 | memory_order __o) |
| 9517 | { |
| 9518 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 9519 | } |
| 9520 | |
| 9521 | inline _LIBCPP_INLINE_VISIBILITY |
| 9522 | unsigned long long |
| 9523 | atomic_fetch_or_explicit(atomic_ullong* __obj, unsigned long long __v, |
| 9524 | memory_order __o) |
| 9525 | { |
| 9526 | return atomic_fetch_or_explicit(const_cast<volatile atomic_ullong*>(__obj), |
| 9527 | __v, __o); |
| 9528 | } |
| 9529 | |
| 9530 | inline _LIBCPP_INLINE_VISIBILITY |
| 9531 | unsigned long long |
| 9532 | atomic_fetch_xor(volatile atomic_ullong* __obj, unsigned long long __v) |
| 9533 | { |
| 9534 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 9535 | } |
| 9536 | |
| 9537 | inline _LIBCPP_INLINE_VISIBILITY |
| 9538 | unsigned long long |
| 9539 | atomic_fetch_xor(atomic_ullong* __obj, unsigned long long __v) |
| 9540 | { |
| 9541 | return atomic_fetch_xor(const_cast<volatile atomic_ullong*>(__obj), __v); |
| 9542 | } |
| 9543 | |
| 9544 | inline _LIBCPP_INLINE_VISIBILITY |
| 9545 | unsigned long long |
| 9546 | atomic_fetch_xor_explicit(volatile atomic_ullong* __obj, unsigned long long __v, |
| 9547 | memory_order __o) |
| 9548 | { |
| 9549 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 9550 | } |
| 9551 | |
| 9552 | inline _LIBCPP_INLINE_VISIBILITY |
| 9553 | unsigned long long |
| 9554 | atomic_fetch_xor_explicit(atomic_ullong* __obj, unsigned long long __v, |
| 9555 | memory_order __o) |
| 9556 | { |
| 9557 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_ullong*>(__obj), |
| 9558 | __v, __o); |
| 9559 | } |
| 9560 | |
| 9561 | #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS |
| 9562 | |
| 9563 | // atomic_char16_t |
| 9564 | |
| 9565 | struct atomic_char16_t; |
| 9566 | |
| 9567 | bool atomic_is_lock_free(const volatile atomic_char16_t*); |
| 9568 | bool atomic_is_lock_free(const atomic_char16_t*); |
| 9569 | void atomic_init(volatile atomic_char16_t*, char16_t); |
| 9570 | void atomic_init(atomic_char16_t*, char16_t); |
| 9571 | void atomic_store(volatile atomic_char16_t*, char16_t); |
| 9572 | void atomic_store(atomic_char16_t*, char16_t); |
| 9573 | void atomic_store_explicit(volatile atomic_char16_t*, char16_t, memory_order); |
| 9574 | void atomic_store_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9575 | char16_t atomic_load(const volatile atomic_char16_t*); |
| 9576 | char16_t atomic_load(const atomic_char16_t*); |
| 9577 | char16_t atomic_load_explicit(const volatile atomic_char16_t*, memory_order); |
| 9578 | char16_t atomic_load_explicit(const atomic_char16_t*, memory_order); |
| 9579 | char16_t atomic_exchange(volatile atomic_char16_t*, char16_t); |
| 9580 | char16_t atomic_exchange(atomic_char16_t*, char16_t); |
| 9581 | char16_t atomic_exchange_explicit(volatile atomic_char16_t*, char16_t, |
| 9582 | memory_order); |
| 9583 | char16_t atomic_exchange_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9584 | bool atomic_compare_exchange_weak(volatile atomic_char16_t*, char16_t*, |
| 9585 | char16_t); |
| 9586 | bool atomic_compare_exchange_weak(atomic_char16_t*, char16_t*, char16_t); |
| 9587 | bool atomic_compare_exchange_strong(volatile atomic_char16_t*, char16_t*, |
| 9588 | char16_t); |
| 9589 | bool atomic_compare_exchange_strong(atomic_char16_t*, char16_t*, char16_t); |
| 9590 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char16_t*, char16_t*, |
| 9591 | char16_t, memory_order, |
| 9592 | memory_order); |
| 9593 | bool atomic_compare_exchange_weak_explicit(atomic_char16_t*, char16_t*, |
| 9594 | char16_t, memory_order, |
| 9595 | memory_order); |
| 9596 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char16_t*, |
| 9597 | char16_t*, char16_t, memory_order, |
| 9598 | memory_order); |
| 9599 | bool atomic_compare_exchange_strong_explicit(atomic_char16_t*, char16_t*, |
| 9600 | char16_t, memory_order, |
| 9601 | memory_order); |
| 9602 | char16_t atomic_fetch_add(volatile atomic_char16_t*, char16_t); |
| 9603 | char16_t atomic_fetch_add(atomic_char16_t*, char16_t); |
| 9604 | char16_t atomic_fetch_add_explicit(volatile atomic_char16_t*, char16_t, |
| 9605 | memory_order); |
| 9606 | char16_t atomic_fetch_add_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9607 | char16_t atomic_fetch_sub(volatile atomic_char16_t*, char16_t); |
| 9608 | char16_t atomic_fetch_sub(atomic_char16_t*, char16_t); |
| 9609 | char16_t atomic_fetch_sub_explicit(volatile atomic_char16_t*, char16_t, |
| 9610 | memory_order); |
| 9611 | char16_t atomic_fetch_sub_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9612 | char16_t atomic_fetch_and(volatile atomic_char16_t*, char16_t); |
| 9613 | char16_t atomic_fetch_and(atomic_char16_t*, char16_t); |
| 9614 | char16_t atomic_fetch_and_explicit(volatile atomic_char16_t*, char16_t, |
| 9615 | memory_order); |
| 9616 | char16_t atomic_fetch_and_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9617 | char16_t atomic_fetch_or(volatile atomic_char16_t*, char16_t); |
| 9618 | char16_t atomic_fetch_or(atomic_char16_t*, char16_t); |
| 9619 | char16_t atomic_fetch_or_explicit(volatile atomic_char16_t*, char16_t, |
| 9620 | memory_order); |
| 9621 | char16_t atomic_fetch_or_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9622 | char16_t atomic_fetch_xor(volatile atomic_char16_t*, char16_t); |
| 9623 | char16_t atomic_fetch_xor(atomic_char16_t*, char16_t); |
| 9624 | char16_t atomic_fetch_xor_explicit(volatile atomic_char16_t*, char16_t, |
| 9625 | memory_order); |
| 9626 | char16_t atomic_fetch_xor_explicit(atomic_char16_t*, char16_t, memory_order); |
| 9627 | |
| 9628 | typedef struct atomic_char16_t |
| 9629 | { |
| 9630 | char16_t __v_; |
| 9631 | |
| 9632 | _LIBCPP_INLINE_VISIBILITY |
| 9633 | bool is_lock_free() const volatile |
| 9634 | {return atomic_is_lock_free(this);} |
| 9635 | _LIBCPP_INLINE_VISIBILITY |
| 9636 | bool is_lock_free() const |
| 9637 | {return atomic_is_lock_free(this);} |
| 9638 | _LIBCPP_INLINE_VISIBILITY |
| 9639 | void store(char16_t __v, memory_order __o = memory_order_seq_cst) volatile |
| 9640 | {atomic_store_explicit(this, __v, __o);} |
| 9641 | _LIBCPP_INLINE_VISIBILITY |
| 9642 | void store(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9643 | {atomic_store_explicit(this, __v, __o);} |
| 9644 | _LIBCPP_INLINE_VISIBILITY |
| 9645 | char16_t load(memory_order __o = memory_order_seq_cst) const volatile |
| 9646 | {return atomic_load_explicit(this, __o);} |
| 9647 | _LIBCPP_INLINE_VISIBILITY |
| 9648 | char16_t load(memory_order __o = memory_order_seq_cst) const |
| 9649 | {return atomic_load_explicit(this, __o);} |
| 9650 | _LIBCPP_INLINE_VISIBILITY |
| 9651 | operator char16_t() const volatile |
| 9652 | {return load();} |
| 9653 | _LIBCPP_INLINE_VISIBILITY |
| 9654 | operator char16_t() const |
| 9655 | {return load();} |
| 9656 | _LIBCPP_INLINE_VISIBILITY |
| 9657 | char16_t exchange(char16_t __v, |
| 9658 | memory_order __o = memory_order_seq_cst) volatile |
| 9659 | {return atomic_exchange_explicit(this, __v, __o);} |
| 9660 | _LIBCPP_INLINE_VISIBILITY |
| 9661 | char16_t exchange(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9662 | {return atomic_exchange_explicit(this, __v, __o);} |
| 9663 | _LIBCPP_INLINE_VISIBILITY |
| 9664 | bool compare_exchange_weak(char16_t& __v, char16_t __e, memory_order __s, |
| 9665 | memory_order __f) volatile |
| 9666 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9667 | __f);} |
| 9668 | _LIBCPP_INLINE_VISIBILITY |
| 9669 | bool compare_exchange_weak(char16_t& __v, char16_t __e, memory_order __s, |
| 9670 | memory_order __f) |
| 9671 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9672 | __f);} |
| 9673 | _LIBCPP_INLINE_VISIBILITY |
| 9674 | bool compare_exchange_strong(char16_t& __v, char16_t __e, memory_order __s, |
| 9675 | memory_order __f) volatile |
| 9676 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9677 | __f);} |
| 9678 | _LIBCPP_INLINE_VISIBILITY |
| 9679 | bool compare_exchange_strong(char16_t& __v, char16_t __e, memory_order __s, |
| 9680 | memory_order __f) |
| 9681 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9682 | __f);} |
| 9683 | _LIBCPP_INLINE_VISIBILITY |
| 9684 | bool compare_exchange_weak(char16_t& __v, char16_t __e, |
| 9685 | memory_order __s = memory_order_seq_cst) volatile |
| 9686 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9687 | __translate_memory_order(__s));} |
| 9688 | _LIBCPP_INLINE_VISIBILITY |
| 9689 | bool compare_exchange_weak(char16_t& __v, char16_t __e, |
| 9690 | memory_order __s = memory_order_seq_cst) |
| 9691 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 9692 | __translate_memory_order(__s));} |
| 9693 | _LIBCPP_INLINE_VISIBILITY |
| 9694 | bool compare_exchange_strong(char16_t& __v, char16_t __e, |
| 9695 | memory_order __s = memory_order_seq_cst) volatile |
| 9696 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9697 | __translate_memory_order(__s));} |
| 9698 | _LIBCPP_INLINE_VISIBILITY |
| 9699 | bool compare_exchange_strong(char16_t& __v, char16_t __e, |
| 9700 | memory_order __s = memory_order_seq_cst) |
| 9701 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 9702 | __translate_memory_order(__s));} |
| 9703 | _LIBCPP_INLINE_VISIBILITY |
| 9704 | char16_t fetch_add(char16_t __v, |
| 9705 | memory_order __o = memory_order_seq_cst) volatile |
| 9706 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 9707 | _LIBCPP_INLINE_VISIBILITY |
| 9708 | char16_t fetch_add(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9709 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 9710 | _LIBCPP_INLINE_VISIBILITY |
| 9711 | char16_t fetch_sub(char16_t __v, |
| 9712 | memory_order __o = memory_order_seq_cst) volatile |
| 9713 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 9714 | _LIBCPP_INLINE_VISIBILITY |
| 9715 | char16_t fetch_sub(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9716 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 9717 | _LIBCPP_INLINE_VISIBILITY |
| 9718 | char16_t fetch_and(char16_t __v, |
| 9719 | memory_order __o = memory_order_seq_cst) volatile |
| 9720 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 9721 | _LIBCPP_INLINE_VISIBILITY |
| 9722 | char16_t fetch_and(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9723 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 9724 | _LIBCPP_INLINE_VISIBILITY |
| 9725 | char16_t fetch_or(char16_t __v, |
| 9726 | memory_order __o = memory_order_seq_cst) volatile |
| 9727 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 9728 | _LIBCPP_INLINE_VISIBILITY |
| 9729 | char16_t fetch_or(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9730 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 9731 | _LIBCPP_INLINE_VISIBILITY |
| 9732 | char16_t fetch_xor(char16_t __v, |
| 9733 | memory_order __o = memory_order_seq_cst) volatile |
| 9734 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 9735 | _LIBCPP_INLINE_VISIBILITY |
| 9736 | char16_t fetch_xor(char16_t __v, memory_order __o = memory_order_seq_cst) |
| 9737 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 9738 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 9739 | atomic_char16_t() = default; |
| 9740 | #else |
| 9741 | _LIBCPP_INLINE_VISIBILITY |
| 9742 | atomic_char16_t() {} |
| 9743 | #endif |
| 9744 | _LIBCPP_INLINE_VISIBILITY |
| 9745 | /*constexpr*/ atomic_char16_t(char16_t __v) |
| 9746 | : __v_(__v) {} |
| 9747 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 9748 | atomic_char16_t(const atomic_char16_t&) = delete; |
| 9749 | atomic_char16_t& operator=(const atomic_char16_t&) = delete; |
| 9750 | atomic_char16_t& operator=(const atomic_char16_t&) volatile = delete; |
| 9751 | #else |
| 9752 | private: |
| 9753 | atomic_char16_t(const atomic_char16_t&); |
| 9754 | atomic_char16_t& operator=(const atomic_char16_t&); |
| 9755 | atomic_char16_t& operator=(const atomic_char16_t&) volatile; |
| 9756 | public: |
| 9757 | #endif |
| 9758 | _LIBCPP_INLINE_VISIBILITY |
| 9759 | char16_t operator=(char16_t __v) volatile |
| 9760 | {store(__v); return __v;} |
| 9761 | _LIBCPP_INLINE_VISIBILITY |
| 9762 | char16_t operator=(char16_t __v) |
| 9763 | {store(__v); return __v;} |
| 9764 | _LIBCPP_INLINE_VISIBILITY |
| 9765 | char16_t operator++(int) volatile |
| 9766 | {return fetch_add(char16_t(1));} |
| 9767 | _LIBCPP_INLINE_VISIBILITY |
| 9768 | char16_t operator++(int) |
| 9769 | {return fetch_add(char16_t(1));} |
| 9770 | _LIBCPP_INLINE_VISIBILITY |
| 9771 | char16_t operator--(int) volatile |
| 9772 | {return fetch_sub(char16_t(1));} |
| 9773 | _LIBCPP_INLINE_VISIBILITY |
| 9774 | char16_t operator--(int) |
| 9775 | {return fetch_sub(char16_t(1));} |
| 9776 | _LIBCPP_INLINE_VISIBILITY |
| 9777 | char16_t operator++() volatile |
| 9778 | {return char16_t(fetch_add(char16_t(1)) + 1);} |
| 9779 | _LIBCPP_INLINE_VISIBILITY |
| 9780 | char16_t operator++() |
| 9781 | {return char16_t(fetch_add(char16_t(1)) + 1);} |
| 9782 | _LIBCPP_INLINE_VISIBILITY |
| 9783 | char16_t operator--() volatile |
| 9784 | {return char16_t(fetch_sub(char16_t(1)) - 1);} |
| 9785 | _LIBCPP_INLINE_VISIBILITY |
| 9786 | char16_t operator--() |
| 9787 | {return char16_t(fetch_sub(char16_t(1)) - 1);} |
| 9788 | _LIBCPP_INLINE_VISIBILITY |
| 9789 | char16_t operator+=(char16_t __v) volatile |
| 9790 | {return char16_t(fetch_add(__v) + __v);} |
| 9791 | _LIBCPP_INLINE_VISIBILITY |
| 9792 | char16_t operator+=(char16_t __v) |
| 9793 | {return char16_t(fetch_add(__v) + __v);} |
| 9794 | _LIBCPP_INLINE_VISIBILITY |
| 9795 | char16_t operator-=(char16_t __v) volatile |
| 9796 | {return char16_t(fetch_sub(__v) - __v);} |
| 9797 | _LIBCPP_INLINE_VISIBILITY |
| 9798 | char16_t operator-=(char16_t __v) |
| 9799 | {return char16_t(fetch_sub(__v) - __v);} |
| 9800 | _LIBCPP_INLINE_VISIBILITY |
| 9801 | char16_t operator&=(char16_t __v) volatile |
| 9802 | {return char16_t(fetch_and(__v) & __v);} |
| 9803 | _LIBCPP_INLINE_VISIBILITY |
| 9804 | char16_t operator&=(char16_t __v) |
| 9805 | {return char16_t(fetch_and(__v) & __v);} |
| 9806 | _LIBCPP_INLINE_VISIBILITY |
| 9807 | char16_t operator|=(char16_t __v) volatile |
| 9808 | {return char16_t(fetch_or(__v) | __v);} |
| 9809 | _LIBCPP_INLINE_VISIBILITY |
| 9810 | char16_t operator|=(char16_t __v) |
| 9811 | {return char16_t(fetch_or(__v) | __v);} |
| 9812 | _LIBCPP_INLINE_VISIBILITY |
| 9813 | char16_t operator^=(char16_t __v) volatile |
| 9814 | {return char16_t(fetch_xor(__v) ^ __v);} |
| 9815 | _LIBCPP_INLINE_VISIBILITY |
| 9816 | char16_t operator^=(char16_t __v) |
| 9817 | {return char16_t(fetch_xor(__v) ^ __v);} |
| 9818 | } atomic_char16_t; |
| 9819 | |
| 9820 | inline _LIBCPP_INLINE_VISIBILITY |
| 9821 | bool |
| 9822 | atomic_is_lock_free(const volatile atomic_char16_t*) |
| 9823 | { |
| 9824 | typedef char16_t type; |
| 9825 | return __atomic_is_lock_free(type); |
| 9826 | } |
| 9827 | |
| 9828 | inline _LIBCPP_INLINE_VISIBILITY |
| 9829 | bool |
| 9830 | atomic_is_lock_free(const atomic_char16_t* __obj) |
| 9831 | { |
| 9832 | return atomic_is_lock_free(const_cast<volatile atomic_char16_t*>(__obj)); |
| 9833 | } |
| 9834 | |
| 9835 | inline _LIBCPP_INLINE_VISIBILITY |
| 9836 | void |
| 9837 | atomic_init(volatile atomic_char16_t* __obj, char16_t __desr) |
| 9838 | { |
| 9839 | __obj->__v_ = __desr; |
| 9840 | } |
| 9841 | |
| 9842 | inline _LIBCPP_INLINE_VISIBILITY |
| 9843 | void |
| 9844 | atomic_init(atomic_char16_t* __obj, char16_t __desr) |
| 9845 | { |
| 9846 | __obj->__v_ = __desr; |
| 9847 | } |
| 9848 | |
| 9849 | inline _LIBCPP_INLINE_VISIBILITY |
| 9850 | void |
| 9851 | atomic_store(volatile atomic_char16_t* __obj, char16_t __desr) |
| 9852 | { |
| 9853 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 9854 | } |
| 9855 | |
| 9856 | inline _LIBCPP_INLINE_VISIBILITY |
| 9857 | void |
| 9858 | atomic_store(atomic_char16_t* __obj, char16_t __desr) |
| 9859 | { |
| 9860 | atomic_store(const_cast<volatile atomic_char16_t*>(__obj), __desr); |
| 9861 | } |
| 9862 | |
| 9863 | inline _LIBCPP_INLINE_VISIBILITY |
| 9864 | void |
| 9865 | atomic_store_explicit(volatile atomic_char16_t* __obj, char16_t __desr, |
| 9866 | memory_order __o) |
| 9867 | { |
| 9868 | __atomic_store(&__obj->__v_, __desr, __o); |
| 9869 | } |
| 9870 | |
| 9871 | inline _LIBCPP_INLINE_VISIBILITY |
| 9872 | void |
| 9873 | atomic_store_explicit(atomic_char16_t* __obj, char16_t __desr, memory_order __o) |
| 9874 | { |
| 9875 | atomic_store_explicit(const_cast<volatile atomic_char16_t*>(__obj), __desr, |
| 9876 | __o); |
| 9877 | } |
| 9878 | |
| 9879 | inline _LIBCPP_INLINE_VISIBILITY |
| 9880 | char16_t |
| 9881 | atomic_load(const volatile atomic_char16_t* __obj) |
| 9882 | { |
| 9883 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 9884 | } |
| 9885 | |
| 9886 | inline _LIBCPP_INLINE_VISIBILITY |
| 9887 | char16_t |
| 9888 | atomic_load(const atomic_char16_t* __obj) |
| 9889 | { |
| 9890 | return atomic_load(const_cast<const volatile atomic_char16_t*>(__obj)); |
| 9891 | } |
| 9892 | |
| 9893 | inline _LIBCPP_INLINE_VISIBILITY |
| 9894 | char16_t |
| 9895 | atomic_load_explicit(const volatile atomic_char16_t* __obj, memory_order __o) |
| 9896 | { |
| 9897 | return __atomic_load(&__obj->__v_, __o); |
| 9898 | } |
| 9899 | |
| 9900 | inline _LIBCPP_INLINE_VISIBILITY |
| 9901 | char16_t |
| 9902 | atomic_load_explicit(const atomic_char16_t* __obj, memory_order __o) |
| 9903 | { |
| 9904 | return atomic_load_explicit(const_cast<const volatile atomic_char16_t*> |
| 9905 | (__obj), __o); |
| 9906 | } |
| 9907 | |
| 9908 | inline _LIBCPP_INLINE_VISIBILITY |
| 9909 | char16_t |
| 9910 | atomic_exchange(volatile atomic_char16_t* __obj, char16_t __desr) |
| 9911 | { |
| 9912 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 9913 | } |
| 9914 | |
| 9915 | inline _LIBCPP_INLINE_VISIBILITY |
| 9916 | char16_t |
| 9917 | atomic_exchange(atomic_char16_t* __obj, char16_t __desr) |
| 9918 | { |
| 9919 | return atomic_exchange(const_cast<volatile atomic_char16_t*>(__obj), __desr); |
| 9920 | } |
| 9921 | |
| 9922 | inline _LIBCPP_INLINE_VISIBILITY |
| 9923 | char16_t |
| 9924 | atomic_exchange_explicit(volatile atomic_char16_t* __obj, char16_t __desr, |
| 9925 | memory_order __o) |
| 9926 | { |
| 9927 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 9928 | } |
| 9929 | |
| 9930 | inline _LIBCPP_INLINE_VISIBILITY |
| 9931 | char16_t |
| 9932 | atomic_exchange_explicit(atomic_char16_t* __obj, char16_t __desr, |
| 9933 | memory_order __o) |
| 9934 | { |
| 9935 | return atomic_exchange_explicit(const_cast<volatile atomic_char16_t*> |
| 9936 | (__obj), __desr, __o); |
| 9937 | } |
| 9938 | |
| 9939 | inline _LIBCPP_INLINE_VISIBILITY |
| 9940 | bool |
| 9941 | atomic_compare_exchange_weak(volatile atomic_char16_t* __obj, char16_t* __exp, |
| 9942 | char16_t __desr) |
| 9943 | { |
| 9944 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 9945 | memory_order_seq_cst, memory_order_seq_cst); |
| 9946 | } |
| 9947 | |
| 9948 | inline _LIBCPP_INLINE_VISIBILITY |
| 9949 | bool |
| 9950 | atomic_compare_exchange_weak(atomic_char16_t* __obj, char16_t* __exp, |
| 9951 | char16_t __desr) |
| 9952 | { |
| 9953 | return atomic_compare_exchange_weak(const_cast<volatile atomic_char16_t*> |
| 9954 | (__obj), __exp, __desr); |
| 9955 | } |
| 9956 | |
| 9957 | inline _LIBCPP_INLINE_VISIBILITY |
| 9958 | bool |
| 9959 | atomic_compare_exchange_strong(volatile atomic_char16_t* __obj, char16_t* __exp, |
| 9960 | char16_t __desr) |
| 9961 | { |
| 9962 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 9963 | memory_order_seq_cst, memory_order_seq_cst); |
| 9964 | } |
| 9965 | |
| 9966 | inline _LIBCPP_INLINE_VISIBILITY |
| 9967 | bool |
| 9968 | atomic_compare_exchange_strong(atomic_char16_t* __obj, char16_t* __exp, |
| 9969 | char16_t __desr) |
| 9970 | { |
| 9971 | return atomic_compare_exchange_strong(const_cast<volatile atomic_char16_t*> |
| 9972 | (__obj), __exp, __desr); |
| 9973 | } |
| 9974 | |
| 9975 | inline _LIBCPP_INLINE_VISIBILITY |
| 9976 | bool |
| 9977 | atomic_compare_exchange_weak_explicit(volatile atomic_char16_t* __obj, |
| 9978 | char16_t* __exp, char16_t __desr, |
| 9979 | memory_order __s, memory_order __f) |
| 9980 | { |
| 9981 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 9982 | __f); |
| 9983 | } |
| 9984 | |
| 9985 | inline _LIBCPP_INLINE_VISIBILITY |
| 9986 | bool |
| 9987 | atomic_compare_exchange_weak_explicit(atomic_char16_t* __obj, char16_t* __exp, |
| 9988 | char16_t __desr, memory_order __s, |
| 9989 | memory_order __f) |
| 9990 | { |
| 9991 | return atomic_compare_exchange_weak_explicit( |
| 9992 | const_cast<volatile atomic_char16_t*>(__obj), __exp, __desr, __s, __f); |
| 9993 | } |
| 9994 | |
| 9995 | inline _LIBCPP_INLINE_VISIBILITY |
| 9996 | bool |
| 9997 | atomic_compare_exchange_strong_explicit(volatile atomic_char16_t* __obj, |
| 9998 | char16_t* __exp, char16_t __desr, |
| 9999 | memory_order __s, memory_order __f) |
| 10000 | { |
| 10001 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 10002 | __f); |
| 10003 | } |
| 10004 | |
| 10005 | inline _LIBCPP_INLINE_VISIBILITY |
| 10006 | bool |
| 10007 | atomic_compare_exchange_strong_explicit(atomic_char16_t* __obj, char16_t* __exp, |
| 10008 | char16_t __desr, memory_order __s, |
| 10009 | memory_order __f) |
| 10010 | { |
| 10011 | return atomic_compare_exchange_strong_explicit( |
| 10012 | const_cast<volatile atomic_char16_t*>(__obj), __exp, __desr, __s, __f); |
| 10013 | } |
| 10014 | |
| 10015 | inline _LIBCPP_INLINE_VISIBILITY |
| 10016 | char16_t |
| 10017 | atomic_fetch_add(volatile atomic_char16_t* __obj, char16_t __v) |
| 10018 | { |
| 10019 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 10020 | } |
| 10021 | |
| 10022 | inline _LIBCPP_INLINE_VISIBILITY |
| 10023 | char16_t |
| 10024 | atomic_fetch_add(atomic_char16_t* __obj, char16_t __v) |
| 10025 | { |
| 10026 | return atomic_fetch_add(const_cast<volatile atomic_char16_t*>(__obj), __v); |
| 10027 | } |
| 10028 | |
| 10029 | inline _LIBCPP_INLINE_VISIBILITY |
| 10030 | char16_t |
| 10031 | atomic_fetch_add_explicit(volatile atomic_char16_t* __obj, char16_t __v, |
| 10032 | memory_order __o) |
| 10033 | { |
| 10034 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 10035 | } |
| 10036 | |
| 10037 | inline _LIBCPP_INLINE_VISIBILITY |
| 10038 | char16_t |
| 10039 | atomic_fetch_add_explicit(atomic_char16_t* __obj, char16_t __v, |
| 10040 | memory_order __o) |
| 10041 | { |
| 10042 | return atomic_fetch_add_explicit(const_cast<volatile atomic_char16_t*>(__obj), |
| 10043 | __v, __o); |
| 10044 | } |
| 10045 | |
| 10046 | inline _LIBCPP_INLINE_VISIBILITY |
| 10047 | char16_t |
| 10048 | atomic_fetch_sub(volatile atomic_char16_t* __obj, char16_t __v) |
| 10049 | { |
| 10050 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 10051 | } |
| 10052 | |
| 10053 | inline _LIBCPP_INLINE_VISIBILITY |
| 10054 | char16_t |
| 10055 | atomic_fetch_sub(atomic_char16_t* __obj, char16_t __v) |
| 10056 | { |
| 10057 | return atomic_fetch_sub(const_cast<volatile atomic_char16_t*>(__obj), __v); |
| 10058 | } |
| 10059 | |
| 10060 | inline _LIBCPP_INLINE_VISIBILITY |
| 10061 | char16_t |
| 10062 | atomic_fetch_sub_explicit(volatile atomic_char16_t* __obj, char16_t __v, |
| 10063 | memory_order __o) |
| 10064 | { |
| 10065 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 10066 | } |
| 10067 | |
| 10068 | inline _LIBCPP_INLINE_VISIBILITY |
| 10069 | char16_t |
| 10070 | atomic_fetch_sub_explicit(atomic_char16_t* __obj, char16_t __v, |
| 10071 | memory_order __o) |
| 10072 | { |
| 10073 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_char16_t*>(__obj), |
| 10074 | __v, __o); |
| 10075 | } |
| 10076 | |
| 10077 | inline _LIBCPP_INLINE_VISIBILITY |
| 10078 | char16_t |
| 10079 | atomic_fetch_and(volatile atomic_char16_t* __obj, char16_t __v) |
| 10080 | { |
| 10081 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 10082 | } |
| 10083 | |
| 10084 | inline _LIBCPP_INLINE_VISIBILITY |
| 10085 | char16_t |
| 10086 | atomic_fetch_and(atomic_char16_t* __obj, char16_t __v) |
| 10087 | { |
| 10088 | return atomic_fetch_and(const_cast<volatile atomic_char16_t*>(__obj), __v); |
| 10089 | } |
| 10090 | |
| 10091 | inline _LIBCPP_INLINE_VISIBILITY |
| 10092 | char16_t |
| 10093 | atomic_fetch_and_explicit(volatile atomic_char16_t* __obj, char16_t __v, |
| 10094 | memory_order __o) |
| 10095 | { |
| 10096 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 10097 | } |
| 10098 | |
| 10099 | inline _LIBCPP_INLINE_VISIBILITY |
| 10100 | char16_t |
| 10101 | atomic_fetch_and_explicit(atomic_char16_t* __obj, char16_t __v, |
| 10102 | memory_order __o) |
| 10103 | { |
| 10104 | return atomic_fetch_and_explicit(const_cast<volatile atomic_char16_t*>(__obj), |
| 10105 | __v, __o); |
| 10106 | } |
| 10107 | |
| 10108 | inline _LIBCPP_INLINE_VISIBILITY |
| 10109 | char16_t |
| 10110 | atomic_fetch_or(volatile atomic_char16_t* __obj, char16_t __v) |
| 10111 | { |
| 10112 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 10113 | } |
| 10114 | |
| 10115 | inline _LIBCPP_INLINE_VISIBILITY |
| 10116 | char16_t |
| 10117 | atomic_fetch_or(atomic_char16_t* __obj, char16_t __v) |
| 10118 | { |
| 10119 | return atomic_fetch_or(const_cast<volatile atomic_char16_t*>(__obj), __v); |
| 10120 | } |
| 10121 | |
| 10122 | inline _LIBCPP_INLINE_VISIBILITY |
| 10123 | char16_t |
| 10124 | atomic_fetch_or_explicit(volatile atomic_char16_t* __obj, char16_t __v, |
| 10125 | memory_order __o) |
| 10126 | { |
| 10127 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 10128 | } |
| 10129 | |
| 10130 | inline _LIBCPP_INLINE_VISIBILITY |
| 10131 | char16_t |
| 10132 | atomic_fetch_or_explicit(atomic_char16_t* __obj, char16_t __v, memory_order __o) |
| 10133 | { |
| 10134 | return atomic_fetch_or_explicit(const_cast<volatile atomic_char16_t*>(__obj), |
| 10135 | __v, __o); |
| 10136 | } |
| 10137 | |
| 10138 | inline _LIBCPP_INLINE_VISIBILITY |
| 10139 | char16_t |
| 10140 | atomic_fetch_xor(volatile atomic_char16_t* __obj, char16_t __v) |
| 10141 | { |
| 10142 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 10143 | } |
| 10144 | |
| 10145 | inline _LIBCPP_INLINE_VISIBILITY |
| 10146 | char16_t |
| 10147 | atomic_fetch_xor(atomic_char16_t* __obj, char16_t __v) |
| 10148 | { |
| 10149 | return atomic_fetch_xor(const_cast<volatile atomic_char16_t*>(__obj), __v); |
| 10150 | } |
| 10151 | |
| 10152 | inline _LIBCPP_INLINE_VISIBILITY |
| 10153 | char16_t |
| 10154 | atomic_fetch_xor_explicit(volatile atomic_char16_t* __obj, char16_t __v, |
| 10155 | memory_order __o) |
| 10156 | { |
| 10157 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 10158 | } |
| 10159 | |
| 10160 | inline _LIBCPP_INLINE_VISIBILITY |
| 10161 | char16_t |
| 10162 | atomic_fetch_xor_explicit(atomic_char16_t* __obj, char16_t __v, |
| 10163 | memory_order __o) |
| 10164 | { |
| 10165 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_char16_t*>(__obj), |
| 10166 | __v, __o); |
| 10167 | } |
| 10168 | |
| 10169 | // atomic_char32_t |
| 10170 | |
| 10171 | struct atomic_char32_t; |
| 10172 | |
| 10173 | bool atomic_is_lock_free(const volatile atomic_char32_t*); |
| 10174 | bool atomic_is_lock_free(const atomic_char32_t*); |
| 10175 | void atomic_init(volatile atomic_char32_t*, char32_t); |
| 10176 | void atomic_init(atomic_char32_t*, char32_t); |
| 10177 | void atomic_store(volatile atomic_char32_t*, char32_t); |
| 10178 | void atomic_store(atomic_char32_t*, char32_t); |
| 10179 | void atomic_store_explicit(volatile atomic_char32_t*, char32_t, memory_order); |
| 10180 | void atomic_store_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10181 | char32_t atomic_load(const volatile atomic_char32_t*); |
| 10182 | char32_t atomic_load(const atomic_char32_t*); |
| 10183 | char32_t atomic_load_explicit(const volatile atomic_char32_t*, memory_order); |
| 10184 | char32_t atomic_load_explicit(const atomic_char32_t*, memory_order); |
| 10185 | char32_t atomic_exchange(volatile atomic_char32_t*, char32_t); |
| 10186 | char32_t atomic_exchange(atomic_char32_t*, char32_t); |
| 10187 | char32_t atomic_exchange_explicit(volatile atomic_char32_t*, char32_t, |
| 10188 | memory_order); |
| 10189 | char32_t atomic_exchange_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10190 | bool atomic_compare_exchange_weak(volatile atomic_char32_t*, char32_t*, |
| 10191 | char32_t); |
| 10192 | bool atomic_compare_exchange_weak(atomic_char32_t*, char32_t*, char32_t); |
| 10193 | bool atomic_compare_exchange_strong(volatile atomic_char32_t*, char32_t*, |
| 10194 | char32_t); |
| 10195 | bool atomic_compare_exchange_strong(atomic_char32_t*, char32_t*, char32_t); |
| 10196 | bool atomic_compare_exchange_weak_explicit(volatile atomic_char32_t*, char32_t*, |
| 10197 | char32_t, memory_order, |
| 10198 | memory_order); |
| 10199 | bool atomic_compare_exchange_weak_explicit(atomic_char32_t*, char32_t*, |
| 10200 | char32_t, memory_order, |
| 10201 | memory_order); |
| 10202 | bool atomic_compare_exchange_strong_explicit(volatile atomic_char32_t*, |
| 10203 | char32_t*, char32_t, memory_order, |
| 10204 | memory_order); |
| 10205 | bool atomic_compare_exchange_strong_explicit(atomic_char32_t*, char32_t*, |
| 10206 | char32_t, memory_order, |
| 10207 | memory_order); |
| 10208 | char32_t atomic_fetch_add(volatile atomic_char32_t*, char32_t); |
| 10209 | char32_t atomic_fetch_add(atomic_char32_t*, char32_t); |
| 10210 | char32_t atomic_fetch_add_explicit(volatile atomic_char32_t*, char32_t, |
| 10211 | memory_order); |
| 10212 | char32_t atomic_fetch_add_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10213 | char32_t atomic_fetch_sub(volatile atomic_char32_t*, char32_t); |
| 10214 | char32_t atomic_fetch_sub(atomic_char32_t*, char32_t); |
| 10215 | char32_t atomic_fetch_sub_explicit(volatile atomic_char32_t*, char32_t, |
| 10216 | memory_order); |
| 10217 | char32_t atomic_fetch_sub_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10218 | char32_t atomic_fetch_and(volatile atomic_char32_t*, char32_t); |
| 10219 | char32_t atomic_fetch_and(atomic_char32_t*, char32_t); |
| 10220 | char32_t atomic_fetch_and_explicit(volatile atomic_char32_t*, char32_t, |
| 10221 | memory_order); |
| 10222 | char32_t atomic_fetch_and_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10223 | char32_t atomic_fetch_or(volatile atomic_char32_t*, char32_t); |
| 10224 | char32_t atomic_fetch_or(atomic_char32_t*, char32_t); |
| 10225 | char32_t atomic_fetch_or_explicit(volatile atomic_char32_t*, char32_t, |
| 10226 | memory_order); |
| 10227 | char32_t atomic_fetch_or_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10228 | char32_t atomic_fetch_xor(volatile atomic_char32_t*, char32_t); |
| 10229 | char32_t atomic_fetch_xor(atomic_char32_t*, char32_t); |
| 10230 | char32_t atomic_fetch_xor_explicit(volatile atomic_char32_t*, char32_t, |
| 10231 | memory_order); |
| 10232 | char32_t atomic_fetch_xor_explicit(atomic_char32_t*, char32_t, memory_order); |
| 10233 | |
| 10234 | typedef struct atomic_char32_t |
| 10235 | { |
| 10236 | char32_t __v_; |
| 10237 | |
| 10238 | _LIBCPP_INLINE_VISIBILITY |
| 10239 | bool is_lock_free() const volatile |
| 10240 | {return atomic_is_lock_free(this);} |
| 10241 | _LIBCPP_INLINE_VISIBILITY |
| 10242 | bool is_lock_free() const |
| 10243 | {return atomic_is_lock_free(this);} |
| 10244 | _LIBCPP_INLINE_VISIBILITY |
| 10245 | void store(char32_t __v, memory_order __o = memory_order_seq_cst) volatile |
| 10246 | {atomic_store_explicit(this, __v, __o);} |
| 10247 | _LIBCPP_INLINE_VISIBILITY |
| 10248 | void store(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10249 | {atomic_store_explicit(this, __v, __o);} |
| 10250 | _LIBCPP_INLINE_VISIBILITY |
| 10251 | char32_t load(memory_order __o = memory_order_seq_cst) const volatile |
| 10252 | {return atomic_load_explicit(this, __o);} |
| 10253 | _LIBCPP_INLINE_VISIBILITY |
| 10254 | char32_t load(memory_order __o = memory_order_seq_cst) const |
| 10255 | {return atomic_load_explicit(this, __o);} |
| 10256 | _LIBCPP_INLINE_VISIBILITY |
| 10257 | operator char32_t() const volatile |
| 10258 | {return load();} |
| 10259 | _LIBCPP_INLINE_VISIBILITY |
| 10260 | operator char32_t() const |
| 10261 | {return load();} |
| 10262 | _LIBCPP_INLINE_VISIBILITY |
| 10263 | char32_t exchange(char32_t __v, |
| 10264 | memory_order __o = memory_order_seq_cst) volatile |
| 10265 | {return atomic_exchange_explicit(this, __v, __o);} |
| 10266 | _LIBCPP_INLINE_VISIBILITY |
| 10267 | char32_t exchange(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10268 | {return atomic_exchange_explicit(this, __v, __o);} |
| 10269 | _LIBCPP_INLINE_VISIBILITY |
| 10270 | bool compare_exchange_weak(char32_t& __v, char32_t __e, memory_order __s, |
| 10271 | memory_order __f) volatile |
| 10272 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10273 | __f);} |
| 10274 | _LIBCPP_INLINE_VISIBILITY |
| 10275 | bool compare_exchange_weak(char32_t& __v, char32_t __e, memory_order __s, |
| 10276 | memory_order __f) |
| 10277 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10278 | __f);} |
| 10279 | _LIBCPP_INLINE_VISIBILITY |
| 10280 | bool compare_exchange_strong(char32_t& __v, char32_t __e, memory_order __s, |
| 10281 | memory_order __f) volatile |
| 10282 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10283 | __f);} |
| 10284 | _LIBCPP_INLINE_VISIBILITY |
| 10285 | bool compare_exchange_strong(char32_t& __v, char32_t __e, memory_order __s, |
| 10286 | memory_order __f) |
| 10287 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10288 | __f);} |
| 10289 | _LIBCPP_INLINE_VISIBILITY |
| 10290 | bool compare_exchange_weak(char32_t& __v, char32_t __e, |
| 10291 | memory_order __s = memory_order_seq_cst) volatile |
| 10292 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10293 | __translate_memory_order(__s));} |
| 10294 | _LIBCPP_INLINE_VISIBILITY |
| 10295 | bool compare_exchange_weak(char32_t& __v, char32_t __e, |
| 10296 | memory_order __s = memory_order_seq_cst) |
| 10297 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10298 | __translate_memory_order(__s));} |
| 10299 | _LIBCPP_INLINE_VISIBILITY |
| 10300 | bool compare_exchange_strong(char32_t& __v, char32_t __e, |
| 10301 | memory_order __s = memory_order_seq_cst) volatile |
| 10302 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10303 | __translate_memory_order(__s));} |
| 10304 | _LIBCPP_INLINE_VISIBILITY |
| 10305 | bool compare_exchange_strong(char32_t& __v, char32_t __e, |
| 10306 | memory_order __s = memory_order_seq_cst) |
| 10307 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10308 | __translate_memory_order(__s));} |
| 10309 | _LIBCPP_INLINE_VISIBILITY |
| 10310 | char32_t fetch_add(char32_t __v, |
| 10311 | memory_order __o = memory_order_seq_cst) volatile |
| 10312 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 10313 | _LIBCPP_INLINE_VISIBILITY |
| 10314 | char32_t fetch_add(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10315 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 10316 | _LIBCPP_INLINE_VISIBILITY |
| 10317 | char32_t fetch_sub(char32_t __v, |
| 10318 | memory_order __o = memory_order_seq_cst) volatile |
| 10319 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 10320 | _LIBCPP_INLINE_VISIBILITY |
| 10321 | char32_t fetch_sub(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10322 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 10323 | _LIBCPP_INLINE_VISIBILITY |
| 10324 | char32_t fetch_and(char32_t __v, |
| 10325 | memory_order __o = memory_order_seq_cst) volatile |
| 10326 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 10327 | _LIBCPP_INLINE_VISIBILITY |
| 10328 | char32_t fetch_and(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10329 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 10330 | _LIBCPP_INLINE_VISIBILITY |
| 10331 | char32_t fetch_or(char32_t __v, |
| 10332 | memory_order __o = memory_order_seq_cst) volatile |
| 10333 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 10334 | _LIBCPP_INLINE_VISIBILITY |
| 10335 | char32_t fetch_or(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10336 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 10337 | _LIBCPP_INLINE_VISIBILITY |
| 10338 | char32_t fetch_xor(char32_t __v, |
| 10339 | memory_order __o = memory_order_seq_cst) volatile |
| 10340 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 10341 | _LIBCPP_INLINE_VISIBILITY |
| 10342 | char32_t fetch_xor(char32_t __v, memory_order __o = memory_order_seq_cst) |
| 10343 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 10344 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 10345 | atomic_char32_t() = default; |
| 10346 | #else |
| 10347 | _LIBCPP_INLINE_VISIBILITY |
| 10348 | atomic_char32_t() {} |
| 10349 | #endif |
| 10350 | _LIBCPP_INLINE_VISIBILITY |
| 10351 | /*constexpr*/ atomic_char32_t(char32_t __v) |
| 10352 | : __v_(__v) {} |
| 10353 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 10354 | atomic_char32_t(const atomic_char32_t&) = delete; |
| 10355 | atomic_char32_t& operator=(const atomic_char32_t&) = delete; |
| 10356 | atomic_char32_t& operator=(const atomic_char32_t&) volatile = delete; |
| 10357 | #else |
| 10358 | private: |
| 10359 | atomic_char32_t(const atomic_char32_t&); |
| 10360 | atomic_char32_t& operator=(const atomic_char32_t&); |
| 10361 | atomic_char32_t& operator=(const atomic_char32_t&) volatile; |
| 10362 | public: |
| 10363 | #endif |
| 10364 | _LIBCPP_INLINE_VISIBILITY |
| 10365 | char32_t operator=(char32_t __v) volatile |
| 10366 | {store(__v); return __v;} |
| 10367 | _LIBCPP_INLINE_VISIBILITY |
| 10368 | char32_t operator=(char32_t __v) |
| 10369 | {store(__v); return __v;} |
| 10370 | _LIBCPP_INLINE_VISIBILITY |
| 10371 | char32_t operator++(int) volatile |
| 10372 | {return fetch_add(char32_t(1));} |
| 10373 | _LIBCPP_INLINE_VISIBILITY |
| 10374 | char32_t operator++(int) |
| 10375 | {return fetch_add(char32_t(1));} |
| 10376 | _LIBCPP_INLINE_VISIBILITY |
| 10377 | char32_t operator--(int) volatile |
| 10378 | {return fetch_sub(char32_t(1));} |
| 10379 | _LIBCPP_INLINE_VISIBILITY |
| 10380 | char32_t operator--(int) |
| 10381 | {return fetch_sub(char32_t(1));} |
| 10382 | _LIBCPP_INLINE_VISIBILITY |
| 10383 | char32_t operator++() volatile |
| 10384 | {return char32_t(fetch_add(char32_t(1)) + 1);} |
| 10385 | _LIBCPP_INLINE_VISIBILITY |
| 10386 | char32_t operator++() |
| 10387 | {return char32_t(fetch_add(char32_t(1)) + 1);} |
| 10388 | _LIBCPP_INLINE_VISIBILITY |
| 10389 | char32_t operator--() volatile |
| 10390 | {return char32_t(fetch_sub(char32_t(1)) - 1);} |
| 10391 | _LIBCPP_INLINE_VISIBILITY |
| 10392 | char32_t operator--() |
| 10393 | {return char32_t(fetch_sub(char32_t(1)) - 1);} |
| 10394 | _LIBCPP_INLINE_VISIBILITY |
| 10395 | char32_t operator+=(char32_t __v) volatile |
| 10396 | {return char32_t(fetch_add(__v) + __v);} |
| 10397 | _LIBCPP_INLINE_VISIBILITY |
| 10398 | char32_t operator+=(char32_t __v) |
| 10399 | {return char32_t(fetch_add(__v) + __v);} |
| 10400 | _LIBCPP_INLINE_VISIBILITY |
| 10401 | char32_t operator-=(char32_t __v) volatile |
| 10402 | {return char32_t(fetch_sub(__v) - __v);} |
| 10403 | _LIBCPP_INLINE_VISIBILITY |
| 10404 | char32_t operator-=(char32_t __v) |
| 10405 | {return char32_t(fetch_sub(__v) - __v);} |
| 10406 | _LIBCPP_INLINE_VISIBILITY |
| 10407 | char32_t operator&=(char32_t __v) volatile |
| 10408 | {return char32_t(fetch_and(__v) & __v);} |
| 10409 | _LIBCPP_INLINE_VISIBILITY |
| 10410 | char32_t operator&=(char32_t __v) |
| 10411 | {return char32_t(fetch_and(__v) & __v);} |
| 10412 | _LIBCPP_INLINE_VISIBILITY |
| 10413 | char32_t operator|=(char32_t __v) volatile |
| 10414 | {return char32_t(fetch_or(__v) | __v);} |
| 10415 | _LIBCPP_INLINE_VISIBILITY |
| 10416 | char32_t operator|=(char32_t __v) |
| 10417 | {return char32_t(fetch_or(__v) | __v);} |
| 10418 | _LIBCPP_INLINE_VISIBILITY |
| 10419 | char32_t operator^=(char32_t __v) volatile |
| 10420 | {return char32_t(fetch_xor(__v) ^ __v);} |
| 10421 | _LIBCPP_INLINE_VISIBILITY |
| 10422 | char32_t operator^=(char32_t __v) |
| 10423 | {return char32_t(fetch_xor(__v) ^ __v);} |
| 10424 | } atomic_char32_t; |
| 10425 | |
| 10426 | inline _LIBCPP_INLINE_VISIBILITY |
| 10427 | bool |
| 10428 | atomic_is_lock_free(const volatile atomic_char32_t*) |
| 10429 | { |
| 10430 | typedef char32_t type; |
| 10431 | return __atomic_is_lock_free(type); |
| 10432 | } |
| 10433 | |
| 10434 | inline _LIBCPP_INLINE_VISIBILITY |
| 10435 | bool |
| 10436 | atomic_is_lock_free(const atomic_char32_t* __obj) |
| 10437 | { |
| 10438 | return atomic_is_lock_free(const_cast<volatile atomic_char32_t*>(__obj)); |
| 10439 | } |
| 10440 | |
| 10441 | inline _LIBCPP_INLINE_VISIBILITY |
| 10442 | void |
| 10443 | atomic_init(volatile atomic_char32_t* __obj, char32_t __desr) |
| 10444 | { |
| 10445 | __obj->__v_ = __desr; |
| 10446 | } |
| 10447 | |
| 10448 | inline _LIBCPP_INLINE_VISIBILITY |
| 10449 | void |
| 10450 | atomic_init(atomic_char32_t* __obj, char32_t __desr) |
| 10451 | { |
| 10452 | __obj->__v_ = __desr; |
| 10453 | } |
| 10454 | |
| 10455 | inline _LIBCPP_INLINE_VISIBILITY |
| 10456 | void |
| 10457 | atomic_store(volatile atomic_char32_t* __obj, char32_t __desr) |
| 10458 | { |
| 10459 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 10460 | } |
| 10461 | |
| 10462 | inline _LIBCPP_INLINE_VISIBILITY |
| 10463 | void |
| 10464 | atomic_store(atomic_char32_t* __obj, char32_t __desr) |
| 10465 | { |
| 10466 | atomic_store(const_cast<volatile atomic_char32_t*>(__obj), __desr); |
| 10467 | } |
| 10468 | |
| 10469 | inline _LIBCPP_INLINE_VISIBILITY |
| 10470 | void |
| 10471 | atomic_store_explicit(volatile atomic_char32_t* __obj, char32_t __desr, |
| 10472 | memory_order __o) |
| 10473 | { |
| 10474 | __atomic_store(&__obj->__v_, __desr, __o); |
| 10475 | } |
| 10476 | |
| 10477 | inline _LIBCPP_INLINE_VISIBILITY |
| 10478 | void |
| 10479 | atomic_store_explicit(atomic_char32_t* __obj, char32_t __desr, memory_order __o) |
| 10480 | { |
| 10481 | atomic_store_explicit(const_cast<volatile atomic_char32_t*>(__obj), __desr, |
| 10482 | __o); |
| 10483 | } |
| 10484 | |
| 10485 | inline _LIBCPP_INLINE_VISIBILITY |
| 10486 | char32_t |
| 10487 | atomic_load(const volatile atomic_char32_t* __obj) |
| 10488 | { |
| 10489 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 10490 | } |
| 10491 | |
| 10492 | inline _LIBCPP_INLINE_VISIBILITY |
| 10493 | char32_t |
| 10494 | atomic_load(const atomic_char32_t* __obj) |
| 10495 | { |
| 10496 | return atomic_load(const_cast<const volatile atomic_char32_t*>(__obj)); |
| 10497 | } |
| 10498 | |
| 10499 | inline _LIBCPP_INLINE_VISIBILITY |
| 10500 | char32_t |
| 10501 | atomic_load_explicit(const volatile atomic_char32_t* __obj, memory_order __o) |
| 10502 | { |
| 10503 | return __atomic_load(&__obj->__v_, __o); |
| 10504 | } |
| 10505 | |
| 10506 | inline _LIBCPP_INLINE_VISIBILITY |
| 10507 | char32_t |
| 10508 | atomic_load_explicit(const atomic_char32_t* __obj, memory_order __o) |
| 10509 | { |
| 10510 | return atomic_load_explicit(const_cast<const volatile atomic_char32_t*> |
| 10511 | (__obj), __o); |
| 10512 | } |
| 10513 | |
| 10514 | inline _LIBCPP_INLINE_VISIBILITY |
| 10515 | char32_t |
| 10516 | atomic_exchange(volatile atomic_char32_t* __obj, char32_t __desr) |
| 10517 | { |
| 10518 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 10519 | } |
| 10520 | |
| 10521 | inline _LIBCPP_INLINE_VISIBILITY |
| 10522 | char32_t |
| 10523 | atomic_exchange(atomic_char32_t* __obj, char32_t __desr) |
| 10524 | { |
| 10525 | return atomic_exchange(const_cast<volatile atomic_char32_t*>(__obj), __desr); |
| 10526 | } |
| 10527 | |
| 10528 | inline _LIBCPP_INLINE_VISIBILITY |
| 10529 | char32_t |
| 10530 | atomic_exchange_explicit(volatile atomic_char32_t* __obj, char32_t __desr, |
| 10531 | memory_order __o) |
| 10532 | { |
| 10533 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 10534 | } |
| 10535 | |
| 10536 | inline _LIBCPP_INLINE_VISIBILITY |
| 10537 | char32_t |
| 10538 | atomic_exchange_explicit(atomic_char32_t* __obj, char32_t __desr, |
| 10539 | memory_order __o) |
| 10540 | { |
| 10541 | return atomic_exchange_explicit(const_cast<volatile atomic_char32_t*> |
| 10542 | (__obj), __desr, __o); |
| 10543 | } |
| 10544 | |
| 10545 | inline _LIBCPP_INLINE_VISIBILITY |
| 10546 | bool |
| 10547 | atomic_compare_exchange_weak(volatile atomic_char32_t* __obj, char32_t* __exp, |
| 10548 | char32_t __desr) |
| 10549 | { |
| 10550 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 10551 | memory_order_seq_cst, memory_order_seq_cst); |
| 10552 | } |
| 10553 | |
| 10554 | inline _LIBCPP_INLINE_VISIBILITY |
| 10555 | bool |
| 10556 | atomic_compare_exchange_weak(atomic_char32_t* __obj, char32_t* __exp, |
| 10557 | char32_t __desr) |
| 10558 | { |
| 10559 | return atomic_compare_exchange_weak(const_cast<volatile atomic_char32_t*> |
| 10560 | (__obj), __exp, __desr); |
| 10561 | } |
| 10562 | |
| 10563 | inline _LIBCPP_INLINE_VISIBILITY |
| 10564 | bool |
| 10565 | atomic_compare_exchange_strong(volatile atomic_char32_t* __obj, char32_t* __exp, |
| 10566 | char32_t __desr) |
| 10567 | { |
| 10568 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 10569 | memory_order_seq_cst, memory_order_seq_cst); |
| 10570 | } |
| 10571 | |
| 10572 | inline _LIBCPP_INLINE_VISIBILITY |
| 10573 | bool |
| 10574 | atomic_compare_exchange_strong(atomic_char32_t* __obj, char32_t* __exp, |
| 10575 | char32_t __desr) |
| 10576 | { |
| 10577 | return atomic_compare_exchange_strong(const_cast<volatile atomic_char32_t*> |
| 10578 | (__obj), __exp, __desr); |
| 10579 | } |
| 10580 | |
| 10581 | inline _LIBCPP_INLINE_VISIBILITY |
| 10582 | bool |
| 10583 | atomic_compare_exchange_weak_explicit(volatile atomic_char32_t* __obj, |
| 10584 | char32_t* __exp, char32_t __desr, |
| 10585 | memory_order __s, memory_order __f) |
| 10586 | { |
| 10587 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 10588 | __f); |
| 10589 | } |
| 10590 | |
| 10591 | inline _LIBCPP_INLINE_VISIBILITY |
| 10592 | bool |
| 10593 | atomic_compare_exchange_weak_explicit(atomic_char32_t* __obj, char32_t* __exp, |
| 10594 | char32_t __desr, memory_order __s, |
| 10595 | memory_order __f) |
| 10596 | { |
| 10597 | return atomic_compare_exchange_weak_explicit( |
| 10598 | const_cast<volatile atomic_char32_t*>(__obj), __exp, __desr, __s, __f); |
| 10599 | } |
| 10600 | |
| 10601 | inline _LIBCPP_INLINE_VISIBILITY |
| 10602 | bool |
| 10603 | atomic_compare_exchange_strong_explicit(volatile atomic_char32_t* __obj, |
| 10604 | char32_t* __exp, char32_t __desr, |
| 10605 | memory_order __s, memory_order __f) |
| 10606 | { |
| 10607 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 10608 | __f); |
| 10609 | } |
| 10610 | |
| 10611 | inline _LIBCPP_INLINE_VISIBILITY |
| 10612 | bool |
| 10613 | atomic_compare_exchange_strong_explicit(atomic_char32_t* __obj, char32_t* __exp, |
| 10614 | char32_t __desr, memory_order __s, |
| 10615 | memory_order __f) |
| 10616 | { |
| 10617 | return atomic_compare_exchange_strong_explicit( |
| 10618 | const_cast<volatile atomic_char32_t*>(__obj), __exp, __desr, __s, __f); |
| 10619 | } |
| 10620 | |
| 10621 | inline _LIBCPP_INLINE_VISIBILITY |
| 10622 | char32_t |
| 10623 | atomic_fetch_add(volatile atomic_char32_t* __obj, char32_t __v) |
| 10624 | { |
| 10625 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 10626 | } |
| 10627 | |
| 10628 | inline _LIBCPP_INLINE_VISIBILITY |
| 10629 | char32_t |
| 10630 | atomic_fetch_add(atomic_char32_t* __obj, char32_t __v) |
| 10631 | { |
| 10632 | return atomic_fetch_add(const_cast<volatile atomic_char32_t*>(__obj), __v); |
| 10633 | } |
| 10634 | |
| 10635 | inline _LIBCPP_INLINE_VISIBILITY |
| 10636 | char32_t |
| 10637 | atomic_fetch_add_explicit(volatile atomic_char32_t* __obj, char32_t __v, |
| 10638 | memory_order __o) |
| 10639 | { |
| 10640 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 10641 | } |
| 10642 | |
| 10643 | inline _LIBCPP_INLINE_VISIBILITY |
| 10644 | char32_t |
| 10645 | atomic_fetch_add_explicit(atomic_char32_t* __obj, char32_t __v, |
| 10646 | memory_order __o) |
| 10647 | { |
| 10648 | return atomic_fetch_add_explicit(const_cast<volatile atomic_char32_t*>(__obj), |
| 10649 | __v, __o); |
| 10650 | } |
| 10651 | |
| 10652 | inline _LIBCPP_INLINE_VISIBILITY |
| 10653 | char32_t |
| 10654 | atomic_fetch_sub(volatile atomic_char32_t* __obj, char32_t __v) |
| 10655 | { |
| 10656 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 10657 | } |
| 10658 | |
| 10659 | inline _LIBCPP_INLINE_VISIBILITY |
| 10660 | char32_t |
| 10661 | atomic_fetch_sub(atomic_char32_t* __obj, char32_t __v) |
| 10662 | { |
| 10663 | return atomic_fetch_sub(const_cast<volatile atomic_char32_t*>(__obj), __v); |
| 10664 | } |
| 10665 | |
| 10666 | inline _LIBCPP_INLINE_VISIBILITY |
| 10667 | char32_t |
| 10668 | atomic_fetch_sub_explicit(volatile atomic_char32_t* __obj, char32_t __v, |
| 10669 | memory_order __o) |
| 10670 | { |
| 10671 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 10672 | } |
| 10673 | |
| 10674 | inline _LIBCPP_INLINE_VISIBILITY |
| 10675 | char32_t |
| 10676 | atomic_fetch_sub_explicit(atomic_char32_t* __obj, char32_t __v, |
| 10677 | memory_order __o) |
| 10678 | { |
| 10679 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_char32_t*>(__obj), |
| 10680 | __v, __o); |
| 10681 | } |
| 10682 | |
| 10683 | inline _LIBCPP_INLINE_VISIBILITY |
| 10684 | char32_t |
| 10685 | atomic_fetch_and(volatile atomic_char32_t* __obj, char32_t __v) |
| 10686 | { |
| 10687 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 10688 | } |
| 10689 | |
| 10690 | inline _LIBCPP_INLINE_VISIBILITY |
| 10691 | char32_t |
| 10692 | atomic_fetch_and(atomic_char32_t* __obj, char32_t __v) |
| 10693 | { |
| 10694 | return atomic_fetch_and(const_cast<volatile atomic_char32_t*>(__obj), __v); |
| 10695 | } |
| 10696 | |
| 10697 | inline _LIBCPP_INLINE_VISIBILITY |
| 10698 | char32_t |
| 10699 | atomic_fetch_and_explicit(volatile atomic_char32_t* __obj, char32_t __v, |
| 10700 | memory_order __o) |
| 10701 | { |
| 10702 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 10703 | } |
| 10704 | |
| 10705 | inline _LIBCPP_INLINE_VISIBILITY |
| 10706 | char32_t |
| 10707 | atomic_fetch_and_explicit(atomic_char32_t* __obj, char32_t __v, |
| 10708 | memory_order __o) |
| 10709 | { |
| 10710 | return atomic_fetch_and_explicit(const_cast<volatile atomic_char32_t*>(__obj), |
| 10711 | __v, __o); |
| 10712 | } |
| 10713 | |
| 10714 | inline _LIBCPP_INLINE_VISIBILITY |
| 10715 | char32_t |
| 10716 | atomic_fetch_or(volatile atomic_char32_t* __obj, char32_t __v) |
| 10717 | { |
| 10718 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 10719 | } |
| 10720 | |
| 10721 | inline _LIBCPP_INLINE_VISIBILITY |
| 10722 | char32_t |
| 10723 | atomic_fetch_or(atomic_char32_t* __obj, char32_t __v) |
| 10724 | { |
| 10725 | return atomic_fetch_or(const_cast<volatile atomic_char32_t*>(__obj), __v); |
| 10726 | } |
| 10727 | |
| 10728 | inline _LIBCPP_INLINE_VISIBILITY |
| 10729 | char32_t |
| 10730 | atomic_fetch_or_explicit(volatile atomic_char32_t* __obj, char32_t __v, |
| 10731 | memory_order __o) |
| 10732 | { |
| 10733 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 10734 | } |
| 10735 | |
| 10736 | inline _LIBCPP_INLINE_VISIBILITY |
| 10737 | char32_t |
| 10738 | atomic_fetch_or_explicit(atomic_char32_t* __obj, char32_t __v, memory_order __o) |
| 10739 | { |
| 10740 | return atomic_fetch_or_explicit(const_cast<volatile atomic_char32_t*>(__obj), |
| 10741 | __v, __o); |
| 10742 | } |
| 10743 | |
| 10744 | inline _LIBCPP_INLINE_VISIBILITY |
| 10745 | char32_t |
| 10746 | atomic_fetch_xor(volatile atomic_char32_t* __obj, char32_t __v) |
| 10747 | { |
| 10748 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 10749 | } |
| 10750 | |
| 10751 | inline _LIBCPP_INLINE_VISIBILITY |
| 10752 | char32_t |
| 10753 | atomic_fetch_xor(atomic_char32_t* __obj, char32_t __v) |
| 10754 | { |
| 10755 | return atomic_fetch_xor(const_cast<volatile atomic_char32_t*>(__obj), __v); |
| 10756 | } |
| 10757 | |
| 10758 | inline _LIBCPP_INLINE_VISIBILITY |
| 10759 | char32_t |
| 10760 | atomic_fetch_xor_explicit(volatile atomic_char32_t* __obj, char32_t __v, |
| 10761 | memory_order __o) |
| 10762 | { |
| 10763 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 10764 | } |
| 10765 | |
| 10766 | inline _LIBCPP_INLINE_VISIBILITY |
| 10767 | char32_t |
| 10768 | atomic_fetch_xor_explicit(atomic_char32_t* __obj, char32_t __v, |
| 10769 | memory_order __o) |
| 10770 | { |
| 10771 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_char32_t*>(__obj), |
| 10772 | __v, __o); |
| 10773 | } |
| 10774 | |
| 10775 | #endif // _LIBCPP_HAS_NO_UNICODE_CHARS |
| 10776 | |
| 10777 | // atomic_wchar_t |
| 10778 | |
| 10779 | struct atomic_wchar_t; |
| 10780 | |
| 10781 | bool atomic_is_lock_free(const volatile atomic_wchar_t*); |
| 10782 | bool atomic_is_lock_free(const atomic_wchar_t*); |
| 10783 | void atomic_init(volatile atomic_wchar_t*, wchar_t); |
| 10784 | void atomic_init(atomic_wchar_t*, wchar_t); |
| 10785 | void atomic_store(volatile atomic_wchar_t*, wchar_t); |
| 10786 | void atomic_store(atomic_wchar_t*, wchar_t); |
| 10787 | void atomic_store_explicit(volatile atomic_wchar_t*, wchar_t, memory_order); |
| 10788 | void atomic_store_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10789 | wchar_t atomic_load(const volatile atomic_wchar_t*); |
| 10790 | wchar_t atomic_load(const atomic_wchar_t*); |
| 10791 | wchar_t atomic_load_explicit(const volatile atomic_wchar_t*, memory_order); |
| 10792 | wchar_t atomic_load_explicit(const atomic_wchar_t*, memory_order); |
| 10793 | wchar_t atomic_exchange(volatile atomic_wchar_t*, wchar_t); |
| 10794 | wchar_t atomic_exchange(atomic_wchar_t*, wchar_t); |
| 10795 | wchar_t atomic_exchange_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10796 | memory_order); |
| 10797 | wchar_t atomic_exchange_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10798 | bool atomic_compare_exchange_weak(volatile atomic_wchar_t*, wchar_t*, |
| 10799 | wchar_t); |
| 10800 | bool atomic_compare_exchange_weak(atomic_wchar_t*, wchar_t*, wchar_t); |
| 10801 | bool atomic_compare_exchange_strong(volatile atomic_wchar_t*, wchar_t*, |
| 10802 | wchar_t); |
| 10803 | bool atomic_compare_exchange_strong(atomic_wchar_t*, wchar_t*, wchar_t); |
| 10804 | bool atomic_compare_exchange_weak_explicit(volatile atomic_wchar_t*, wchar_t*, |
| 10805 | wchar_t, memory_order, |
| 10806 | memory_order); |
| 10807 | bool atomic_compare_exchange_weak_explicit(atomic_wchar_t*, wchar_t*, |
| 10808 | wchar_t, memory_order, |
| 10809 | memory_order); |
| 10810 | bool atomic_compare_exchange_strong_explicit(volatile atomic_wchar_t*, |
| 10811 | wchar_t*, wchar_t, memory_order, |
| 10812 | memory_order); |
| 10813 | bool atomic_compare_exchange_strong_explicit(atomic_wchar_t*, wchar_t*, |
| 10814 | wchar_t, memory_order, |
| 10815 | memory_order); |
| 10816 | wchar_t atomic_fetch_add(volatile atomic_wchar_t*, wchar_t); |
| 10817 | wchar_t atomic_fetch_add(atomic_wchar_t*, wchar_t); |
| 10818 | wchar_t atomic_fetch_add_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10819 | memory_order); |
| 10820 | wchar_t atomic_fetch_add_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10821 | wchar_t atomic_fetch_sub(volatile atomic_wchar_t*, wchar_t); |
| 10822 | wchar_t atomic_fetch_sub(atomic_wchar_t*, wchar_t); |
| 10823 | wchar_t atomic_fetch_sub_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10824 | memory_order); |
| 10825 | wchar_t atomic_fetch_sub_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10826 | wchar_t atomic_fetch_and(volatile atomic_wchar_t*, wchar_t); |
| 10827 | wchar_t atomic_fetch_and(atomic_wchar_t*, wchar_t); |
| 10828 | wchar_t atomic_fetch_and_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10829 | memory_order); |
| 10830 | wchar_t atomic_fetch_and_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10831 | wchar_t atomic_fetch_or(volatile atomic_wchar_t*, wchar_t); |
| 10832 | wchar_t atomic_fetch_or(atomic_wchar_t*, wchar_t); |
| 10833 | wchar_t atomic_fetch_or_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10834 | memory_order); |
| 10835 | wchar_t atomic_fetch_or_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10836 | wchar_t atomic_fetch_xor(volatile atomic_wchar_t*, wchar_t); |
| 10837 | wchar_t atomic_fetch_xor(atomic_wchar_t*, wchar_t); |
| 10838 | wchar_t atomic_fetch_xor_explicit(volatile atomic_wchar_t*, wchar_t, |
| 10839 | memory_order); |
| 10840 | wchar_t atomic_fetch_xor_explicit(atomic_wchar_t*, wchar_t, memory_order); |
| 10841 | |
| 10842 | typedef struct atomic_wchar_t |
| 10843 | { |
| 10844 | wchar_t __v_; |
| 10845 | |
| 10846 | _LIBCPP_INLINE_VISIBILITY |
| 10847 | bool is_lock_free() const volatile |
| 10848 | {return atomic_is_lock_free(this);} |
| 10849 | _LIBCPP_INLINE_VISIBILITY |
| 10850 | bool is_lock_free() const |
| 10851 | {return atomic_is_lock_free(this);} |
| 10852 | _LIBCPP_INLINE_VISIBILITY |
| 10853 | void store(wchar_t __v, memory_order __o = memory_order_seq_cst) volatile |
| 10854 | {atomic_store_explicit(this, __v, __o);} |
| 10855 | _LIBCPP_INLINE_VISIBILITY |
| 10856 | void store(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10857 | {atomic_store_explicit(this, __v, __o);} |
| 10858 | _LIBCPP_INLINE_VISIBILITY |
| 10859 | wchar_t load(memory_order __o = memory_order_seq_cst) const volatile |
| 10860 | {return atomic_load_explicit(this, __o);} |
| 10861 | _LIBCPP_INLINE_VISIBILITY |
| 10862 | wchar_t load(memory_order __o = memory_order_seq_cst) const |
| 10863 | {return atomic_load_explicit(this, __o);} |
| 10864 | _LIBCPP_INLINE_VISIBILITY |
| 10865 | operator wchar_t() const volatile |
| 10866 | {return load();} |
| 10867 | _LIBCPP_INLINE_VISIBILITY |
| 10868 | operator wchar_t() const |
| 10869 | {return load();} |
| 10870 | _LIBCPP_INLINE_VISIBILITY |
| 10871 | wchar_t exchange(wchar_t __v, |
| 10872 | memory_order __o = memory_order_seq_cst) volatile |
| 10873 | {return atomic_exchange_explicit(this, __v, __o);} |
| 10874 | _LIBCPP_INLINE_VISIBILITY |
| 10875 | wchar_t exchange(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10876 | {return atomic_exchange_explicit(this, __v, __o);} |
| 10877 | _LIBCPP_INLINE_VISIBILITY |
| 10878 | bool compare_exchange_weak(wchar_t& __v, wchar_t __e, memory_order __s, |
| 10879 | memory_order __f) volatile |
| 10880 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10881 | __f);} |
| 10882 | _LIBCPP_INLINE_VISIBILITY |
| 10883 | bool compare_exchange_weak(wchar_t& __v, wchar_t __e, memory_order __s, |
| 10884 | memory_order __f) |
| 10885 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10886 | __f);} |
| 10887 | _LIBCPP_INLINE_VISIBILITY |
| 10888 | bool compare_exchange_strong(wchar_t& __v, wchar_t __e, memory_order __s, |
| 10889 | memory_order __f) volatile |
| 10890 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10891 | __f);} |
| 10892 | _LIBCPP_INLINE_VISIBILITY |
| 10893 | bool compare_exchange_strong(wchar_t& __v, wchar_t __e, memory_order __s, |
| 10894 | memory_order __f) |
| 10895 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10896 | __f);} |
| 10897 | _LIBCPP_INLINE_VISIBILITY |
| 10898 | bool compare_exchange_weak(wchar_t& __v, wchar_t __e, |
| 10899 | memory_order __s = memory_order_seq_cst) volatile |
| 10900 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10901 | __translate_memory_order(__s));} |
| 10902 | _LIBCPP_INLINE_VISIBILITY |
| 10903 | bool compare_exchange_weak(wchar_t& __v, wchar_t __e, |
| 10904 | memory_order __s = memory_order_seq_cst) |
| 10905 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 10906 | __translate_memory_order(__s));} |
| 10907 | _LIBCPP_INLINE_VISIBILITY |
| 10908 | bool compare_exchange_strong(wchar_t& __v, wchar_t __e, |
| 10909 | memory_order __s = memory_order_seq_cst) volatile |
| 10910 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10911 | __translate_memory_order(__s));} |
| 10912 | _LIBCPP_INLINE_VISIBILITY |
| 10913 | bool compare_exchange_strong(wchar_t& __v, wchar_t __e, |
| 10914 | memory_order __s = memory_order_seq_cst) |
| 10915 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 10916 | __translate_memory_order(__s));} |
| 10917 | _LIBCPP_INLINE_VISIBILITY |
| 10918 | wchar_t fetch_add(wchar_t __v, |
| 10919 | memory_order __o = memory_order_seq_cst) volatile |
| 10920 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 10921 | _LIBCPP_INLINE_VISIBILITY |
| 10922 | wchar_t fetch_add(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10923 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 10924 | _LIBCPP_INLINE_VISIBILITY |
| 10925 | wchar_t fetch_sub(wchar_t __v, |
| 10926 | memory_order __o = memory_order_seq_cst) volatile |
| 10927 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 10928 | _LIBCPP_INLINE_VISIBILITY |
| 10929 | wchar_t fetch_sub(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10930 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 10931 | _LIBCPP_INLINE_VISIBILITY |
| 10932 | wchar_t fetch_and(wchar_t __v, |
| 10933 | memory_order __o = memory_order_seq_cst) volatile |
| 10934 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 10935 | _LIBCPP_INLINE_VISIBILITY |
| 10936 | wchar_t fetch_and(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10937 | {return atomic_fetch_and_explicit(this, __v, __o);} |
| 10938 | _LIBCPP_INLINE_VISIBILITY |
| 10939 | wchar_t fetch_or(wchar_t __v, |
| 10940 | memory_order __o = memory_order_seq_cst) volatile |
| 10941 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 10942 | _LIBCPP_INLINE_VISIBILITY |
| 10943 | wchar_t fetch_or(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10944 | {return atomic_fetch_or_explicit(this, __v, __o);} |
| 10945 | _LIBCPP_INLINE_VISIBILITY |
| 10946 | wchar_t fetch_xor(wchar_t __v, |
| 10947 | memory_order __o = memory_order_seq_cst) volatile |
| 10948 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 10949 | _LIBCPP_INLINE_VISIBILITY |
| 10950 | wchar_t fetch_xor(wchar_t __v, memory_order __o = memory_order_seq_cst) |
| 10951 | {return atomic_fetch_xor_explicit(this, __v, __o);} |
| 10952 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 10953 | atomic_wchar_t() = default; |
| 10954 | #else |
| 10955 | _LIBCPP_INLINE_VISIBILITY |
| 10956 | atomic_wchar_t() {} |
| 10957 | #endif |
| 10958 | _LIBCPP_INLINE_VISIBILITY |
| 10959 | /*constexpr*/ atomic_wchar_t(wchar_t __v) |
| 10960 | : __v_(__v) {} |
| 10961 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 10962 | atomic_wchar_t(const atomic_wchar_t&) = delete; |
| 10963 | atomic_wchar_t& operator=(const atomic_wchar_t&) = delete; |
| 10964 | atomic_wchar_t& operator=(const atomic_wchar_t&) volatile = delete; |
| 10965 | #else |
| 10966 | private: |
| 10967 | atomic_wchar_t(const atomic_wchar_t&); |
| 10968 | atomic_wchar_t& operator=(const atomic_wchar_t&); |
| 10969 | atomic_wchar_t& operator=(const atomic_wchar_t&) volatile; |
| 10970 | public: |
| 10971 | #endif |
| 10972 | _LIBCPP_INLINE_VISIBILITY |
| 10973 | wchar_t operator=(wchar_t __v) volatile |
| 10974 | {store(__v); return __v;} |
| 10975 | _LIBCPP_INLINE_VISIBILITY |
| 10976 | wchar_t operator=(wchar_t __v) |
| 10977 | {store(__v); return __v;} |
| 10978 | _LIBCPP_INLINE_VISIBILITY |
| 10979 | wchar_t operator++(int) volatile |
| 10980 | {return fetch_add(wchar_t(1));} |
| 10981 | _LIBCPP_INLINE_VISIBILITY |
| 10982 | wchar_t operator++(int) |
| 10983 | {return fetch_add(wchar_t(1));} |
| 10984 | _LIBCPP_INLINE_VISIBILITY |
| 10985 | wchar_t operator--(int) volatile |
| 10986 | {return fetch_sub(wchar_t(1));} |
| 10987 | _LIBCPP_INLINE_VISIBILITY |
| 10988 | wchar_t operator--(int) |
| 10989 | {return fetch_sub(wchar_t(1));} |
| 10990 | _LIBCPP_INLINE_VISIBILITY |
| 10991 | wchar_t operator++() volatile |
| 10992 | {return wchar_t(fetch_add(wchar_t(1)) + 1);} |
| 10993 | _LIBCPP_INLINE_VISIBILITY |
| 10994 | wchar_t operator++() |
| 10995 | {return wchar_t(fetch_add(wchar_t(1)) + 1);} |
| 10996 | _LIBCPP_INLINE_VISIBILITY |
| 10997 | wchar_t operator--() volatile |
| 10998 | {return wchar_t(fetch_sub(wchar_t(1)) - 1);} |
| 10999 | _LIBCPP_INLINE_VISIBILITY |
| 11000 | wchar_t operator--() |
| 11001 | {return wchar_t(fetch_sub(wchar_t(1)) - 1);} |
| 11002 | _LIBCPP_INLINE_VISIBILITY |
| 11003 | wchar_t operator+=(wchar_t __v) volatile |
| 11004 | {return wchar_t(fetch_add(__v) + __v);} |
| 11005 | _LIBCPP_INLINE_VISIBILITY |
| 11006 | wchar_t operator+=(wchar_t __v) |
| 11007 | {return wchar_t(fetch_add(__v) + __v);} |
| 11008 | _LIBCPP_INLINE_VISIBILITY |
| 11009 | wchar_t operator-=(wchar_t __v) volatile |
| 11010 | {return wchar_t(fetch_sub(__v) - __v);} |
| 11011 | _LIBCPP_INLINE_VISIBILITY |
| 11012 | wchar_t operator-=(wchar_t __v) |
| 11013 | {return wchar_t(fetch_sub(__v) - __v);} |
| 11014 | _LIBCPP_INLINE_VISIBILITY |
| 11015 | wchar_t operator&=(wchar_t __v) volatile |
| 11016 | {return wchar_t(fetch_and(__v) & __v);} |
| 11017 | _LIBCPP_INLINE_VISIBILITY |
| 11018 | wchar_t operator&=(wchar_t __v) |
| 11019 | {return wchar_t(fetch_and(__v) & __v);} |
| 11020 | _LIBCPP_INLINE_VISIBILITY |
| 11021 | wchar_t operator|=(wchar_t __v) volatile |
| 11022 | {return wchar_t(fetch_or(__v) | __v);} |
| 11023 | _LIBCPP_INLINE_VISIBILITY |
| 11024 | wchar_t operator|=(wchar_t __v) |
| 11025 | {return wchar_t(fetch_or(__v) | __v);} |
| 11026 | _LIBCPP_INLINE_VISIBILITY |
| 11027 | wchar_t operator^=(wchar_t __v) volatile |
| 11028 | {return wchar_t(fetch_xor(__v) ^ __v);} |
| 11029 | _LIBCPP_INLINE_VISIBILITY |
| 11030 | wchar_t operator^=(wchar_t __v) |
| 11031 | {return wchar_t(fetch_xor(__v) ^ __v);} |
| 11032 | } atomic_wchar_t; |
| 11033 | |
| 11034 | inline _LIBCPP_INLINE_VISIBILITY |
| 11035 | bool |
| 11036 | atomic_is_lock_free(const volatile atomic_wchar_t*) |
| 11037 | { |
| 11038 | typedef wchar_t type; |
| 11039 | return __atomic_is_lock_free(type); |
| 11040 | } |
| 11041 | |
| 11042 | inline _LIBCPP_INLINE_VISIBILITY |
| 11043 | bool |
| 11044 | atomic_is_lock_free(const atomic_wchar_t* __obj) |
| 11045 | { |
| 11046 | return atomic_is_lock_free(const_cast<volatile atomic_wchar_t*>(__obj)); |
| 11047 | } |
| 11048 | |
| 11049 | inline _LIBCPP_INLINE_VISIBILITY |
| 11050 | void |
| 11051 | atomic_init(volatile atomic_wchar_t* __obj, wchar_t __desr) |
| 11052 | { |
| 11053 | __obj->__v_ = __desr; |
| 11054 | } |
| 11055 | |
| 11056 | inline _LIBCPP_INLINE_VISIBILITY |
| 11057 | void |
| 11058 | atomic_init(atomic_wchar_t* __obj, wchar_t __desr) |
| 11059 | { |
| 11060 | __obj->__v_ = __desr; |
| 11061 | } |
| 11062 | |
| 11063 | inline _LIBCPP_INLINE_VISIBILITY |
| 11064 | void |
| 11065 | atomic_store(volatile atomic_wchar_t* __obj, wchar_t __desr) |
| 11066 | { |
| 11067 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 11068 | } |
| 11069 | |
| 11070 | inline _LIBCPP_INLINE_VISIBILITY |
| 11071 | void |
| 11072 | atomic_store(atomic_wchar_t* __obj, wchar_t __desr) |
| 11073 | { |
| 11074 | atomic_store(const_cast<volatile atomic_wchar_t*>(__obj), __desr); |
| 11075 | } |
| 11076 | |
| 11077 | inline _LIBCPP_INLINE_VISIBILITY |
| 11078 | void |
| 11079 | atomic_store_explicit(volatile atomic_wchar_t* __obj, wchar_t __desr, |
| 11080 | memory_order __o) |
| 11081 | { |
| 11082 | __atomic_store(&__obj->__v_, __desr, __o); |
| 11083 | } |
| 11084 | |
| 11085 | inline _LIBCPP_INLINE_VISIBILITY |
| 11086 | void |
| 11087 | atomic_store_explicit(atomic_wchar_t* __obj, wchar_t __desr, memory_order __o) |
| 11088 | { |
| 11089 | atomic_store_explicit(const_cast<volatile atomic_wchar_t*>(__obj), __desr, |
| 11090 | __o); |
| 11091 | } |
| 11092 | |
| 11093 | inline _LIBCPP_INLINE_VISIBILITY |
| 11094 | wchar_t |
| 11095 | atomic_load(const volatile atomic_wchar_t* __obj) |
| 11096 | { |
| 11097 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 11098 | } |
| 11099 | |
| 11100 | inline _LIBCPP_INLINE_VISIBILITY |
| 11101 | wchar_t |
| 11102 | atomic_load(const atomic_wchar_t* __obj) |
| 11103 | { |
| 11104 | return atomic_load(const_cast<const volatile atomic_wchar_t*>(__obj)); |
| 11105 | } |
| 11106 | |
| 11107 | inline _LIBCPP_INLINE_VISIBILITY |
| 11108 | wchar_t |
| 11109 | atomic_load_explicit(const volatile atomic_wchar_t* __obj, memory_order __o) |
| 11110 | { |
| 11111 | return __atomic_load(&__obj->__v_, __o); |
| 11112 | } |
| 11113 | |
| 11114 | inline _LIBCPP_INLINE_VISIBILITY |
| 11115 | wchar_t |
| 11116 | atomic_load_explicit(const atomic_wchar_t* __obj, memory_order __o) |
| 11117 | { |
| 11118 | return atomic_load_explicit(const_cast<const volatile atomic_wchar_t*> |
| 11119 | (__obj), __o); |
| 11120 | } |
| 11121 | |
| 11122 | inline _LIBCPP_INLINE_VISIBILITY |
| 11123 | wchar_t |
| 11124 | atomic_exchange(volatile atomic_wchar_t* __obj, wchar_t __desr) |
| 11125 | { |
| 11126 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 11127 | } |
| 11128 | |
| 11129 | inline _LIBCPP_INLINE_VISIBILITY |
| 11130 | wchar_t |
| 11131 | atomic_exchange(atomic_wchar_t* __obj, wchar_t __desr) |
| 11132 | { |
| 11133 | return atomic_exchange(const_cast<volatile atomic_wchar_t*>(__obj), __desr); |
| 11134 | } |
| 11135 | |
| 11136 | inline _LIBCPP_INLINE_VISIBILITY |
| 11137 | wchar_t |
| 11138 | atomic_exchange_explicit(volatile atomic_wchar_t* __obj, wchar_t __desr, |
| 11139 | memory_order __o) |
| 11140 | { |
| 11141 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 11142 | } |
| 11143 | |
| 11144 | inline _LIBCPP_INLINE_VISIBILITY |
| 11145 | wchar_t |
| 11146 | atomic_exchange_explicit(atomic_wchar_t* __obj, wchar_t __desr, |
| 11147 | memory_order __o) |
| 11148 | { |
| 11149 | return atomic_exchange_explicit(const_cast<volatile atomic_wchar_t*> |
| 11150 | (__obj), __desr, __o); |
| 11151 | } |
| 11152 | |
| 11153 | inline _LIBCPP_INLINE_VISIBILITY |
| 11154 | bool |
| 11155 | atomic_compare_exchange_weak(volatile atomic_wchar_t* __obj, wchar_t* __exp, |
| 11156 | wchar_t __desr) |
| 11157 | { |
| 11158 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 11159 | memory_order_seq_cst, memory_order_seq_cst); |
| 11160 | } |
| 11161 | |
| 11162 | inline _LIBCPP_INLINE_VISIBILITY |
| 11163 | bool |
| 11164 | atomic_compare_exchange_weak(atomic_wchar_t* __obj, wchar_t* __exp, |
| 11165 | wchar_t __desr) |
| 11166 | { |
| 11167 | return atomic_compare_exchange_weak(const_cast<volatile atomic_wchar_t*> |
| 11168 | (__obj), __exp, __desr); |
| 11169 | } |
| 11170 | |
| 11171 | inline _LIBCPP_INLINE_VISIBILITY |
| 11172 | bool |
| 11173 | atomic_compare_exchange_strong(volatile atomic_wchar_t* __obj, wchar_t* __exp, |
| 11174 | wchar_t __desr) |
| 11175 | { |
| 11176 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 11177 | memory_order_seq_cst, memory_order_seq_cst); |
| 11178 | } |
| 11179 | |
| 11180 | inline _LIBCPP_INLINE_VISIBILITY |
| 11181 | bool |
| 11182 | atomic_compare_exchange_strong(atomic_wchar_t* __obj, wchar_t* __exp, |
| 11183 | wchar_t __desr) |
| 11184 | { |
| 11185 | return atomic_compare_exchange_strong(const_cast<volatile atomic_wchar_t*> |
| 11186 | (__obj), __exp, __desr); |
| 11187 | } |
| 11188 | |
| 11189 | inline _LIBCPP_INLINE_VISIBILITY |
| 11190 | bool |
| 11191 | atomic_compare_exchange_weak_explicit(volatile atomic_wchar_t* __obj, |
| 11192 | wchar_t* __exp, wchar_t __desr, |
| 11193 | memory_order __s, memory_order __f) |
| 11194 | { |
| 11195 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 11196 | __f); |
| 11197 | } |
| 11198 | |
| 11199 | inline _LIBCPP_INLINE_VISIBILITY |
| 11200 | bool |
| 11201 | atomic_compare_exchange_weak_explicit(atomic_wchar_t* __obj, wchar_t* __exp, |
| 11202 | wchar_t __desr, memory_order __s, |
| 11203 | memory_order __f) |
| 11204 | { |
| 11205 | return atomic_compare_exchange_weak_explicit( |
| 11206 | const_cast<volatile atomic_wchar_t*>(__obj), __exp, __desr, __s, __f); |
| 11207 | } |
| 11208 | |
| 11209 | inline _LIBCPP_INLINE_VISIBILITY |
| 11210 | bool |
| 11211 | atomic_compare_exchange_strong_explicit(volatile atomic_wchar_t* __obj, |
| 11212 | wchar_t* __exp, wchar_t __desr, |
| 11213 | memory_order __s, memory_order __f) |
| 11214 | { |
| 11215 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 11216 | __f); |
| 11217 | } |
| 11218 | |
| 11219 | inline _LIBCPP_INLINE_VISIBILITY |
| 11220 | bool |
| 11221 | atomic_compare_exchange_strong_explicit(atomic_wchar_t* __obj, wchar_t* __exp, |
| 11222 | wchar_t __desr, memory_order __s, |
| 11223 | memory_order __f) |
| 11224 | { |
| 11225 | return atomic_compare_exchange_strong_explicit( |
| 11226 | const_cast<volatile atomic_wchar_t*>(__obj), __exp, __desr, __s, __f); |
| 11227 | } |
| 11228 | |
| 11229 | inline _LIBCPP_INLINE_VISIBILITY |
| 11230 | wchar_t |
| 11231 | atomic_fetch_add(volatile atomic_wchar_t* __obj, wchar_t __v) |
| 11232 | { |
| 11233 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 11234 | } |
| 11235 | |
| 11236 | inline _LIBCPP_INLINE_VISIBILITY |
| 11237 | wchar_t |
| 11238 | atomic_fetch_add(atomic_wchar_t* __obj, wchar_t __v) |
| 11239 | { |
| 11240 | return atomic_fetch_add(const_cast<volatile atomic_wchar_t*>(__obj), __v); |
| 11241 | } |
| 11242 | |
| 11243 | inline _LIBCPP_INLINE_VISIBILITY |
| 11244 | wchar_t |
| 11245 | atomic_fetch_add_explicit(volatile atomic_wchar_t* __obj, wchar_t __v, |
| 11246 | memory_order __o) |
| 11247 | { |
| 11248 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 11249 | } |
| 11250 | |
| 11251 | inline _LIBCPP_INLINE_VISIBILITY |
| 11252 | wchar_t |
| 11253 | atomic_fetch_add_explicit(atomic_wchar_t* __obj, wchar_t __v, |
| 11254 | memory_order __o) |
| 11255 | { |
| 11256 | return atomic_fetch_add_explicit(const_cast<volatile atomic_wchar_t*>(__obj), |
| 11257 | __v, __o); |
| 11258 | } |
| 11259 | |
| 11260 | inline _LIBCPP_INLINE_VISIBILITY |
| 11261 | wchar_t |
| 11262 | atomic_fetch_sub(volatile atomic_wchar_t* __obj, wchar_t __v) |
| 11263 | { |
| 11264 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 11265 | } |
| 11266 | |
| 11267 | inline _LIBCPP_INLINE_VISIBILITY |
| 11268 | wchar_t |
| 11269 | atomic_fetch_sub(atomic_wchar_t* __obj, wchar_t __v) |
| 11270 | { |
| 11271 | return atomic_fetch_sub(const_cast<volatile atomic_wchar_t*>(__obj), __v); |
| 11272 | } |
| 11273 | |
| 11274 | inline _LIBCPP_INLINE_VISIBILITY |
| 11275 | wchar_t |
| 11276 | atomic_fetch_sub_explicit(volatile atomic_wchar_t* __obj, wchar_t __v, |
| 11277 | memory_order __o) |
| 11278 | { |
| 11279 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 11280 | } |
| 11281 | |
| 11282 | inline _LIBCPP_INLINE_VISIBILITY |
| 11283 | wchar_t |
| 11284 | atomic_fetch_sub_explicit(atomic_wchar_t* __obj, wchar_t __v, |
| 11285 | memory_order __o) |
| 11286 | { |
| 11287 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_wchar_t*>(__obj), |
| 11288 | __v, __o); |
| 11289 | } |
| 11290 | |
| 11291 | inline _LIBCPP_INLINE_VISIBILITY |
| 11292 | wchar_t |
| 11293 | atomic_fetch_and(volatile atomic_wchar_t* __obj, wchar_t __v) |
| 11294 | { |
| 11295 | return __atomic_fetch_and(&__obj->__v_, __v, memory_order_seq_cst); |
| 11296 | } |
| 11297 | |
| 11298 | inline _LIBCPP_INLINE_VISIBILITY |
| 11299 | wchar_t |
| 11300 | atomic_fetch_and(atomic_wchar_t* __obj, wchar_t __v) |
| 11301 | { |
| 11302 | return atomic_fetch_and(const_cast<volatile atomic_wchar_t*>(__obj), __v); |
| 11303 | } |
| 11304 | |
| 11305 | inline _LIBCPP_INLINE_VISIBILITY |
| 11306 | wchar_t |
| 11307 | atomic_fetch_and_explicit(volatile atomic_wchar_t* __obj, wchar_t __v, |
| 11308 | memory_order __o) |
| 11309 | { |
| 11310 | return __atomic_fetch_and(&__obj->__v_, __v, __o); |
| 11311 | } |
| 11312 | |
| 11313 | inline _LIBCPP_INLINE_VISIBILITY |
| 11314 | wchar_t |
| 11315 | atomic_fetch_and_explicit(atomic_wchar_t* __obj, wchar_t __v, |
| 11316 | memory_order __o) |
| 11317 | { |
| 11318 | return atomic_fetch_and_explicit(const_cast<volatile atomic_wchar_t*>(__obj), |
| 11319 | __v, __o); |
| 11320 | } |
| 11321 | |
| 11322 | inline _LIBCPP_INLINE_VISIBILITY |
| 11323 | wchar_t |
| 11324 | atomic_fetch_or(volatile atomic_wchar_t* __obj, wchar_t __v) |
| 11325 | { |
| 11326 | return __atomic_fetch_or(&__obj->__v_, __v, memory_order_seq_cst); |
| 11327 | } |
| 11328 | |
| 11329 | inline _LIBCPP_INLINE_VISIBILITY |
| 11330 | wchar_t |
| 11331 | atomic_fetch_or(atomic_wchar_t* __obj, wchar_t __v) |
| 11332 | { |
| 11333 | return atomic_fetch_or(const_cast<volatile atomic_wchar_t*>(__obj), __v); |
| 11334 | } |
| 11335 | |
| 11336 | inline _LIBCPP_INLINE_VISIBILITY |
| 11337 | wchar_t |
| 11338 | atomic_fetch_or_explicit(volatile atomic_wchar_t* __obj, wchar_t __v, |
| 11339 | memory_order __o) |
| 11340 | { |
| 11341 | return __atomic_fetch_or(&__obj->__v_, __v, __o); |
| 11342 | } |
| 11343 | |
| 11344 | inline _LIBCPP_INLINE_VISIBILITY |
| 11345 | wchar_t |
| 11346 | atomic_fetch_or_explicit(atomic_wchar_t* __obj, wchar_t __v, memory_order __o) |
| 11347 | { |
| 11348 | return atomic_fetch_or_explicit(const_cast<volatile atomic_wchar_t*>(__obj), |
| 11349 | __v, __o); |
| 11350 | } |
| 11351 | |
| 11352 | inline _LIBCPP_INLINE_VISIBILITY |
| 11353 | wchar_t |
| 11354 | atomic_fetch_xor(volatile atomic_wchar_t* __obj, wchar_t __v) |
| 11355 | { |
| 11356 | return __atomic_fetch_xor(&__obj->__v_, __v, memory_order_seq_cst); |
| 11357 | } |
| 11358 | |
| 11359 | inline _LIBCPP_INLINE_VISIBILITY |
| 11360 | wchar_t |
| 11361 | atomic_fetch_xor(atomic_wchar_t* __obj, wchar_t __v) |
| 11362 | { |
| 11363 | return atomic_fetch_xor(const_cast<volatile atomic_wchar_t*>(__obj), __v); |
| 11364 | } |
| 11365 | |
| 11366 | inline _LIBCPP_INLINE_VISIBILITY |
| 11367 | wchar_t |
| 11368 | atomic_fetch_xor_explicit(volatile atomic_wchar_t* __obj, wchar_t __v, |
| 11369 | memory_order __o) |
| 11370 | { |
| 11371 | return __atomic_fetch_xor(&__obj->__v_, __v, __o); |
| 11372 | } |
| 11373 | |
| 11374 | inline _LIBCPP_INLINE_VISIBILITY |
| 11375 | wchar_t |
| 11376 | atomic_fetch_xor_explicit(atomic_wchar_t* __obj, wchar_t __v, |
| 11377 | memory_order __o) |
| 11378 | { |
| 11379 | return atomic_fetch_xor_explicit(const_cast<volatile atomic_wchar_t*>(__obj), |
| 11380 | __v, __o); |
| 11381 | } |
| 11382 | |
Howard Hinnant | bce9c31 | 2010-10-21 17:44:19 +0000 | [diff] [blame^] | 11383 | // atomic_address |
| 11384 | |
| 11385 | struct atomic_address; |
| 11386 | |
| 11387 | bool atomic_is_lock_free(const volatile atomic_address*); |
| 11388 | bool atomic_is_lock_free(const atomic_address*); |
| 11389 | void atomic_init(volatile atomic_address*, void*); |
| 11390 | void atomic_init(atomic_address*, void*); |
| 11391 | void atomic_store(volatile atomic_address*, void*); |
| 11392 | void atomic_store(atomic_address*, void*); |
| 11393 | void atomic_store_explicit(volatile atomic_address*, void*, memory_order); |
| 11394 | void atomic_store_explicit(atomic_address*, void*, memory_order); |
| 11395 | void* atomic_load(const volatile atomic_address*); |
| 11396 | void* atomic_load(const atomic_address*); |
| 11397 | void* atomic_load_explicit(const volatile atomic_address*, memory_order); |
| 11398 | void* atomic_load_explicit(const atomic_address*, memory_order); |
| 11399 | void* atomic_exchange(volatile atomic_address*, void*); |
| 11400 | void* atomic_exchange(atomic_address*, void*); |
| 11401 | void* atomic_exchange_explicit(volatile atomic_address*, void*, memory_order); |
| 11402 | void* atomic_exchange_explicit(atomic_address*, void*, memory_order); |
| 11403 | bool atomic_compare_exchange_weak(volatile atomic_address*, void**, void*); |
| 11404 | bool atomic_compare_exchange_weak(atomic_address*, void**, void*); |
| 11405 | bool atomic_compare_exchange_strong(volatile atomic_address*, void**, void*); |
| 11406 | bool atomic_compare_exchange_strong(atomic_address*, void**, void*); |
| 11407 | bool atomic_compare_exchange_weak_explicit(volatile atomic_address*, void**, |
| 11408 | void*, memory_order, memory_order); |
| 11409 | bool atomic_compare_exchange_weak_explicit(atomic_address*, void**, |
| 11410 | void*, memory_order, memory_order); |
| 11411 | bool atomic_compare_exchange_strong_explicit(volatile atomic_address*, void**, |
| 11412 | void*, memory_order, memory_order); |
| 11413 | bool atomic_compare_exchange_strong_explicit(atomic_address*, void**, |
| 11414 | void*, memory_order, memory_order); |
| 11415 | void* atomic_fetch_add(volatile atomic_address*, ptrdiff_t); |
| 11416 | void* atomic_fetch_add(atomic_address*, ptrdiff_t); |
| 11417 | void* atomic_fetch_add_explicit(volatile atomic_address*, ptrdiff_t, |
| 11418 | memory_order); |
| 11419 | void* atomic_fetch_add_explicit(atomic_address*, ptrdiff_t, memory_order); |
| 11420 | void* atomic_fetch_sub(volatile atomic_address*, ptrdiff_t); |
| 11421 | void* atomic_fetch_sub(atomic_address*, ptrdiff_t); |
| 11422 | void* atomic_fetch_sub_explicit(volatile atomic_address*, ptrdiff_t, |
| 11423 | memory_order); |
| 11424 | void* atomic_fetch_sub_explicit(atomic_address*, ptrdiff_t, memory_order); |
| 11425 | |
| 11426 | typedef struct atomic_address |
| 11427 | { |
| 11428 | void* __v_; |
| 11429 | |
| 11430 | _LIBCPP_INLINE_VISIBILITY |
| 11431 | bool is_lock_free() const volatile |
| 11432 | {return atomic_is_lock_free(this);} |
| 11433 | _LIBCPP_INLINE_VISIBILITY |
| 11434 | bool is_lock_free() const |
| 11435 | {return atomic_is_lock_free(this);} |
| 11436 | _LIBCPP_INLINE_VISIBILITY |
| 11437 | void store(void* __v, memory_order __o = memory_order_seq_cst) volatile |
| 11438 | {atomic_store_explicit(this, __v, __o);} |
| 11439 | _LIBCPP_INLINE_VISIBILITY |
| 11440 | void store(void* __v, memory_order __o = memory_order_seq_cst) |
| 11441 | {atomic_store_explicit(this, __v, __o);} |
| 11442 | _LIBCPP_INLINE_VISIBILITY |
| 11443 | void* load(memory_order __o = memory_order_seq_cst) const volatile |
| 11444 | {return atomic_load_explicit(this, __o);} |
| 11445 | _LIBCPP_INLINE_VISIBILITY |
| 11446 | void* load(memory_order __o = memory_order_seq_cst) const |
| 11447 | {return atomic_load_explicit(this, __o);} |
| 11448 | _LIBCPP_INLINE_VISIBILITY |
| 11449 | operator void*() const volatile |
| 11450 | {return load();} |
| 11451 | _LIBCPP_INLINE_VISIBILITY |
| 11452 | operator void*() const |
| 11453 | {return load();} |
| 11454 | _LIBCPP_INLINE_VISIBILITY |
| 11455 | void* exchange(void* __v, memory_order __o = memory_order_seq_cst) volatile |
| 11456 | {return atomic_exchange_explicit(this, __v, __o);} |
| 11457 | _LIBCPP_INLINE_VISIBILITY |
| 11458 | void* exchange(void* __v, memory_order __o = memory_order_seq_cst) |
| 11459 | {return atomic_exchange_explicit(this, __v, __o);} |
| 11460 | _LIBCPP_INLINE_VISIBILITY |
| 11461 | bool compare_exchange_weak(void*& __v, void* __e, memory_order __s, |
| 11462 | memory_order __f) volatile |
| 11463 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 11464 | __f);} |
| 11465 | _LIBCPP_INLINE_VISIBILITY |
| 11466 | bool compare_exchange_weak(void*& __v, void* __e, memory_order __s, |
| 11467 | memory_order __f) |
| 11468 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 11469 | __f);} |
| 11470 | _LIBCPP_INLINE_VISIBILITY |
| 11471 | bool compare_exchange_strong(void*& __v, void* __e, memory_order __s, |
| 11472 | memory_order __f) volatile |
| 11473 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 11474 | __f);} |
| 11475 | _LIBCPP_INLINE_VISIBILITY |
| 11476 | bool compare_exchange_strong(void*& __v, void* __e, memory_order __s, |
| 11477 | memory_order __f) |
| 11478 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 11479 | __f);} |
| 11480 | _LIBCPP_INLINE_VISIBILITY |
| 11481 | bool compare_exchange_weak(void*& __v, void* __e, |
| 11482 | memory_order __s = memory_order_seq_cst) volatile |
| 11483 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 11484 | __translate_memory_order(__s));} |
| 11485 | _LIBCPP_INLINE_VISIBILITY |
| 11486 | bool compare_exchange_weak(void*& __v, void* __e, |
| 11487 | memory_order __s = memory_order_seq_cst) |
| 11488 | {return atomic_compare_exchange_weak_explicit(this, &__v, __e, __s, |
| 11489 | __translate_memory_order(__s));} |
| 11490 | _LIBCPP_INLINE_VISIBILITY |
| 11491 | bool compare_exchange_strong(void*& __v, void* __e, |
| 11492 | memory_order __s = memory_order_seq_cst) volatile |
| 11493 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 11494 | __translate_memory_order(__s));} |
| 11495 | _LIBCPP_INLINE_VISIBILITY |
| 11496 | bool compare_exchange_strong(void*& __v, void* __e, |
| 11497 | memory_order __s = memory_order_seq_cst) |
| 11498 | {return atomic_compare_exchange_strong_explicit(this, &__v, __e, __s, |
| 11499 | __translate_memory_order(__s));} |
| 11500 | _LIBCPP_INLINE_VISIBILITY |
| 11501 | bool compare_exchange_weak(const void*& __v, const void* __e, |
| 11502 | memory_order __s, memory_order __f) volatile |
| 11503 | {return atomic_compare_exchange_weak_explicit(this, |
| 11504 | &const_cast<void*&>(__v), const_cast<void*>(__e), __s, __f);} |
| 11505 | _LIBCPP_INLINE_VISIBILITY |
| 11506 | bool compare_exchange_weak(const void*& __v, const void* __e, |
| 11507 | memory_order __s, memory_order __f) |
| 11508 | {return atomic_compare_exchange_weak_explicit(this, |
| 11509 | &const_cast<void*&>(__v), const_cast<void*>(__e), __s, __f);} |
| 11510 | _LIBCPP_INLINE_VISIBILITY |
| 11511 | bool compare_exchange_strong(const void*& __v, const void* __e, |
| 11512 | memory_order __s, memory_order __f) volatile |
| 11513 | {return atomic_compare_exchange_strong_explicit(this, |
| 11514 | &const_cast<void*&>(__v), const_cast<void*>(__e), __s, __f);} |
| 11515 | _LIBCPP_INLINE_VISIBILITY |
| 11516 | bool compare_exchange_strong(const void*& __v, const void* __e, |
| 11517 | memory_order __s, memory_order __f) |
| 11518 | {return atomic_compare_exchange_strong_explicit(this, |
| 11519 | &const_cast<void*&>(__v), const_cast<void*>(__e), __s, __f);} |
| 11520 | _LIBCPP_INLINE_VISIBILITY |
| 11521 | bool compare_exchange_weak(const void*& __v, const void* __e, |
| 11522 | memory_order __s = memory_order_seq_cst) volatile |
| 11523 | {return atomic_compare_exchange_weak_explicit(this, |
| 11524 | &const_cast<void*&>(__v), const_cast<void*>(__e), |
| 11525 | __s, __translate_memory_order(__s));} |
| 11526 | _LIBCPP_INLINE_VISIBILITY |
| 11527 | bool compare_exchange_weak(const void*& __v, const void* __e, |
| 11528 | memory_order __s = memory_order_seq_cst) |
| 11529 | {return atomic_compare_exchange_weak_explicit(this, |
| 11530 | &const_cast<void*&>(__v), const_cast<void*>(__e), |
| 11531 | __s, __translate_memory_order(__s));} |
| 11532 | _LIBCPP_INLINE_VISIBILITY |
| 11533 | bool compare_exchange_strong(const void*& __v, const void* __e, |
| 11534 | memory_order __s = memory_order_seq_cst) volatile |
| 11535 | {return atomic_compare_exchange_strong_explicit(this, |
| 11536 | &const_cast<void*&>(__v), const_cast<void*>(__e), |
| 11537 | __s, __translate_memory_order(__s));} |
| 11538 | _LIBCPP_INLINE_VISIBILITY |
| 11539 | bool compare_exchange_strong(const void*& __v, const void* __e, |
| 11540 | memory_order __s = memory_order_seq_cst) |
| 11541 | {return atomic_compare_exchange_strong_explicit(this, |
| 11542 | &const_cast<void*&>(__v), const_cast<void*>(__e), |
| 11543 | __s, __translate_memory_order(__s));} |
| 11544 | _LIBCPP_INLINE_VISIBILITY |
| 11545 | void* fetch_add(ptrdiff_t __v, |
| 11546 | memory_order __o = memory_order_seq_cst) volatile |
| 11547 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 11548 | _LIBCPP_INLINE_VISIBILITY |
| 11549 | void* fetch_add(ptrdiff_t __v, memory_order __o = memory_order_seq_cst) |
| 11550 | {return atomic_fetch_add_explicit(this, __v, __o);} |
| 11551 | _LIBCPP_INLINE_VISIBILITY |
| 11552 | void* fetch_sub(ptrdiff_t __v, |
| 11553 | memory_order __o = memory_order_seq_cst) volatile |
| 11554 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 11555 | _LIBCPP_INLINE_VISIBILITY |
| 11556 | void* fetch_sub(ptrdiff_t __v, memory_order __o = memory_order_seq_cst) |
| 11557 | {return atomic_fetch_sub_explicit(this, __v, __o);} |
| 11558 | #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS |
| 11559 | atomic_address() = default; |
| 11560 | #else |
| 11561 | _LIBCPP_INLINE_VISIBILITY |
| 11562 | atomic_address() {} |
| 11563 | #endif |
| 11564 | _LIBCPP_INLINE_VISIBILITY |
| 11565 | /*constexpr*/ atomic_address(void* __v) |
| 11566 | : __v_(__v) {} |
| 11567 | #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS |
| 11568 | atomic_address(const atomic_address&) = delete; |
| 11569 | atomic_address& operator=(const atomic_address&) = delete; |
| 11570 | atomic_address& operator=(const atomic_address&) volatile = delete; |
| 11571 | #else |
| 11572 | private: |
| 11573 | atomic_address(const atomic_address&); |
| 11574 | atomic_address& operator=(const atomic_address&); |
| 11575 | atomic_address& operator=(const atomic_address&) volatile; |
| 11576 | public: |
| 11577 | #endif |
| 11578 | _LIBCPP_INLINE_VISIBILITY |
| 11579 | void* operator=(const void* __v) volatile |
| 11580 | {store(const_cast<void*>(__v)); return const_cast<void*>(__v);} |
| 11581 | _LIBCPP_INLINE_VISIBILITY |
| 11582 | void* operator=(const void* __v) |
| 11583 | {store(const_cast<void*>(__v)); return const_cast<void*>(__v);} |
| 11584 | _LIBCPP_INLINE_VISIBILITY |
| 11585 | void* operator+=(ptrdiff_t __v) volatile |
| 11586 | {return static_cast<char*>(fetch_add(__v)) + __v;} |
| 11587 | _LIBCPP_INLINE_VISIBILITY |
| 11588 | void* operator+=(ptrdiff_t __v) |
| 11589 | {return static_cast<char*>(fetch_add(__v)) + __v;} |
| 11590 | _LIBCPP_INLINE_VISIBILITY |
| 11591 | void* operator-=(ptrdiff_t __v) volatile |
| 11592 | {return static_cast<char*>(fetch_sub(__v)) - __v;} |
| 11593 | _LIBCPP_INLINE_VISIBILITY |
| 11594 | void* operator-=(ptrdiff_t __v) |
| 11595 | {return static_cast<char*>(fetch_sub(__v)) - __v;} |
| 11596 | } atomic_address; |
| 11597 | |
| 11598 | inline _LIBCPP_INLINE_VISIBILITY |
| 11599 | bool |
| 11600 | atomic_is_lock_free(const volatile atomic_address*) |
| 11601 | { |
| 11602 | typedef void* type; |
| 11603 | return __atomic_is_lock_free(type); |
| 11604 | } |
| 11605 | |
| 11606 | inline _LIBCPP_INLINE_VISIBILITY |
| 11607 | bool |
| 11608 | atomic_is_lock_free(const atomic_address* __obj) |
| 11609 | { |
| 11610 | return atomic_is_lock_free(const_cast<volatile atomic_address*>(__obj)); |
| 11611 | } |
| 11612 | |
| 11613 | inline _LIBCPP_INLINE_VISIBILITY |
| 11614 | void |
| 11615 | atomic_init(volatile atomic_address* __obj, void* __desr) |
| 11616 | { |
| 11617 | __obj->__v_ = __desr; |
| 11618 | } |
| 11619 | |
| 11620 | inline _LIBCPP_INLINE_VISIBILITY |
| 11621 | void |
| 11622 | atomic_init(atomic_address* __obj, void* __desr) |
| 11623 | { |
| 11624 | __obj->__v_ = __desr; |
| 11625 | } |
| 11626 | |
| 11627 | inline _LIBCPP_INLINE_VISIBILITY |
| 11628 | void |
| 11629 | atomic_store(volatile atomic_address* __obj, void* __desr) |
| 11630 | { |
| 11631 | __atomic_store(&__obj->__v_, __desr, memory_order_seq_cst); |
| 11632 | } |
| 11633 | |
| 11634 | inline _LIBCPP_INLINE_VISIBILITY |
| 11635 | void |
| 11636 | atomic_store(atomic_address* __obj, void* __desr) |
| 11637 | { |
| 11638 | atomic_store(const_cast<volatile atomic_address*>(__obj), __desr); |
| 11639 | } |
| 11640 | |
| 11641 | inline _LIBCPP_INLINE_VISIBILITY |
| 11642 | void |
| 11643 | atomic_store_explicit(volatile atomic_address* __obj, void* __desr, |
| 11644 | memory_order __o) |
| 11645 | { |
| 11646 | __atomic_store(&__obj->__v_, __desr, __o); |
| 11647 | } |
| 11648 | |
| 11649 | inline _LIBCPP_INLINE_VISIBILITY |
| 11650 | void |
| 11651 | atomic_store_explicit(atomic_address* __obj, void* __desr, memory_order __o) |
| 11652 | { |
| 11653 | atomic_store_explicit(const_cast<volatile atomic_address*>(__obj), __desr, |
| 11654 | __o); |
| 11655 | } |
| 11656 | |
| 11657 | inline _LIBCPP_INLINE_VISIBILITY |
| 11658 | void* |
| 11659 | atomic_load(const volatile atomic_address* __obj) |
| 11660 | { |
| 11661 | return __atomic_load(&__obj->__v_, memory_order_seq_cst); |
| 11662 | } |
| 11663 | |
| 11664 | inline _LIBCPP_INLINE_VISIBILITY |
| 11665 | void* |
| 11666 | atomic_load(const atomic_address* __obj) |
| 11667 | { |
| 11668 | return atomic_load(const_cast<const volatile atomic_address*>(__obj)); |
| 11669 | } |
| 11670 | |
| 11671 | inline _LIBCPP_INLINE_VISIBILITY |
| 11672 | void* |
| 11673 | atomic_load_explicit(const volatile atomic_address* __obj, memory_order __o) |
| 11674 | { |
| 11675 | return __atomic_load(&__obj->__v_, __o); |
| 11676 | } |
| 11677 | |
| 11678 | inline _LIBCPP_INLINE_VISIBILITY |
| 11679 | void* |
| 11680 | atomic_load_explicit(const atomic_address* __obj, memory_order __o) |
| 11681 | { |
| 11682 | return atomic_load_explicit(const_cast<const volatile atomic_address*> |
| 11683 | (__obj), __o); |
| 11684 | } |
| 11685 | |
| 11686 | inline _LIBCPP_INLINE_VISIBILITY |
| 11687 | void* |
| 11688 | atomic_exchange(volatile atomic_address* __obj, void* __desr) |
| 11689 | { |
| 11690 | return __atomic_exchange(&__obj->__v_, __desr, memory_order_seq_cst); |
| 11691 | } |
| 11692 | |
| 11693 | inline _LIBCPP_INLINE_VISIBILITY |
| 11694 | void* |
| 11695 | atomic_exchange(atomic_address* __obj, void* __desr) |
| 11696 | { |
| 11697 | return atomic_exchange(const_cast<volatile atomic_address*>(__obj), __desr); |
| 11698 | } |
| 11699 | |
| 11700 | inline _LIBCPP_INLINE_VISIBILITY |
| 11701 | void* |
| 11702 | atomic_exchange_explicit(volatile atomic_address* __obj, void* __desr, |
| 11703 | memory_order __o) |
| 11704 | { |
| 11705 | return __atomic_exchange(&__obj->__v_, __desr, __o); |
| 11706 | } |
| 11707 | |
| 11708 | inline _LIBCPP_INLINE_VISIBILITY |
| 11709 | void* |
| 11710 | atomic_exchange_explicit(atomic_address* __obj, void* __desr, memory_order __o) |
| 11711 | { |
| 11712 | return atomic_exchange_explicit(const_cast<volatile atomic_address*> |
| 11713 | (__obj), __desr, __o); |
| 11714 | } |
| 11715 | |
| 11716 | inline _LIBCPP_INLINE_VISIBILITY |
| 11717 | bool |
| 11718 | atomic_compare_exchange_weak(volatile atomic_address* __obj, void** __exp, |
| 11719 | void* __desr) |
| 11720 | { |
| 11721 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, |
| 11722 | memory_order_seq_cst, memory_order_seq_cst); |
| 11723 | } |
| 11724 | |
| 11725 | inline _LIBCPP_INLINE_VISIBILITY |
| 11726 | bool |
| 11727 | atomic_compare_exchange_weak(atomic_address* __obj, void** __exp, void* __desr) |
| 11728 | { |
| 11729 | return atomic_compare_exchange_weak(const_cast<volatile atomic_address*> |
| 11730 | (__obj), __exp, __desr); |
| 11731 | } |
| 11732 | |
| 11733 | inline _LIBCPP_INLINE_VISIBILITY |
| 11734 | bool |
| 11735 | atomic_compare_exchange_strong(volatile atomic_address* __obj, void** __exp, |
| 11736 | void* __desr) |
| 11737 | { |
| 11738 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, |
| 11739 | memory_order_seq_cst, memory_order_seq_cst); |
| 11740 | } |
| 11741 | |
| 11742 | inline _LIBCPP_INLINE_VISIBILITY |
| 11743 | bool |
| 11744 | atomic_compare_exchange_strong(atomic_address* __obj, void** __exp, |
| 11745 | void* __desr) |
| 11746 | { |
| 11747 | return atomic_compare_exchange_strong(const_cast<volatile atomic_address*> |
| 11748 | (__obj), __exp, __desr); |
| 11749 | } |
| 11750 | |
| 11751 | inline _LIBCPP_INLINE_VISIBILITY |
| 11752 | bool |
| 11753 | atomic_compare_exchange_weak_explicit(volatile atomic_address* __obj, |
| 11754 | void** __exp, void* __desr, |
| 11755 | memory_order __s, memory_order __f) |
| 11756 | { |
| 11757 | return __atomic_compare_exchange_weak(&__obj->__v_, __exp, __desr, __s, |
| 11758 | __f); |
| 11759 | } |
| 11760 | |
| 11761 | inline _LIBCPP_INLINE_VISIBILITY |
| 11762 | bool |
| 11763 | atomic_compare_exchange_weak_explicit(atomic_address* __obj, void** __exp, |
| 11764 | void* __desr, memory_order __s, |
| 11765 | memory_order __f) |
| 11766 | { |
| 11767 | return atomic_compare_exchange_weak_explicit( |
| 11768 | const_cast<volatile atomic_address*>(__obj), __exp, __desr, __s, __f); |
| 11769 | } |
| 11770 | |
| 11771 | inline _LIBCPP_INLINE_VISIBILITY |
| 11772 | bool |
| 11773 | atomic_compare_exchange_strong_explicit(volatile atomic_address* __obj, |
| 11774 | void** __exp, void* __desr, |
| 11775 | memory_order __s, memory_order __f) |
| 11776 | { |
| 11777 | return __atomic_compare_exchange_strong(&__obj->__v_, __exp, __desr, __s, |
| 11778 | __f); |
| 11779 | } |
| 11780 | |
| 11781 | inline _LIBCPP_INLINE_VISIBILITY |
| 11782 | bool |
| 11783 | atomic_compare_exchange_strong_explicit(atomic_address* __obj, void** __exp, |
| 11784 | void* __desr, memory_order __s, |
| 11785 | memory_order __f) |
| 11786 | { |
| 11787 | return atomic_compare_exchange_strong_explicit( |
| 11788 | const_cast<volatile atomic_address*>(__obj), __exp, __desr, __s, __f); |
| 11789 | } |
| 11790 | |
| 11791 | inline _LIBCPP_INLINE_VISIBILITY |
| 11792 | void* |
| 11793 | atomic_fetch_add(volatile atomic_address* __obj, ptrdiff_t __v) |
| 11794 | { |
| 11795 | return __atomic_fetch_add(&__obj->__v_, __v, memory_order_seq_cst); |
| 11796 | } |
| 11797 | |
| 11798 | inline _LIBCPP_INLINE_VISIBILITY |
| 11799 | void* |
| 11800 | atomic_fetch_add(atomic_address* __obj, ptrdiff_t __v) |
| 11801 | { |
| 11802 | return atomic_fetch_add(const_cast<volatile atomic_address*>(__obj), __v); |
| 11803 | } |
| 11804 | |
| 11805 | inline _LIBCPP_INLINE_VISIBILITY |
| 11806 | void* |
| 11807 | atomic_fetch_add_explicit(volatile atomic_address* __obj, ptrdiff_t __v, |
| 11808 | memory_order __o) |
| 11809 | { |
| 11810 | return __atomic_fetch_add(&__obj->__v_, __v, __o); |
| 11811 | } |
| 11812 | |
| 11813 | inline _LIBCPP_INLINE_VISIBILITY |
| 11814 | void* |
| 11815 | atomic_fetch_add_explicit(atomic_address* __obj, ptrdiff_t __v, |
| 11816 | memory_order __o) |
| 11817 | { |
| 11818 | return atomic_fetch_add_explicit(const_cast<volatile atomic_address*>(__obj), |
| 11819 | __v, __o); |
| 11820 | } |
| 11821 | |
| 11822 | inline _LIBCPP_INLINE_VISIBILITY |
| 11823 | void* |
| 11824 | atomic_fetch_sub(volatile atomic_address* __obj, ptrdiff_t __v) |
| 11825 | { |
| 11826 | return __atomic_fetch_sub(&__obj->__v_, __v, memory_order_seq_cst); |
| 11827 | } |
| 11828 | |
| 11829 | inline _LIBCPP_INLINE_VISIBILITY |
| 11830 | void* |
| 11831 | atomic_fetch_sub(atomic_address* __obj, ptrdiff_t __v) |
| 11832 | { |
| 11833 | return atomic_fetch_sub(const_cast<volatile atomic_address*>(__obj), __v); |
| 11834 | } |
| 11835 | |
| 11836 | inline _LIBCPP_INLINE_VISIBILITY |
| 11837 | void* |
| 11838 | atomic_fetch_sub_explicit(volatile atomic_address* __obj, ptrdiff_t __v, |
| 11839 | memory_order __o) |
| 11840 | { |
| 11841 | return __atomic_fetch_sub(&__obj->__v_, __v, __o); |
| 11842 | } |
| 11843 | |
| 11844 | inline _LIBCPP_INLINE_VISIBILITY |
| 11845 | void* |
| 11846 | atomic_fetch_sub_explicit(atomic_address* __obj, ptrdiff_t __v, |
| 11847 | memory_order __o) |
| 11848 | { |
| 11849 | return atomic_fetch_sub_explicit(const_cast<volatile atomic_address*>(__obj), |
| 11850 | __v, __o); |
| 11851 | } |
| 11852 | |
Howard Hinnant | 8f73c63 | 2010-09-27 21:17:38 +0000 | [diff] [blame] | 11853 | _LIBCPP_END_NAMESPACE_STD |
| 11854 | |
| 11855 | #endif // _LIBCPP_ATOMIC |