1 #ifndef BOOST_DETAIL_ATOMIC_CAS32STRONG_HPP 2 #define BOOST_DETAIL_ATOMIC_CAS32STRONG_HPP 22 template<
typename T,
bool Sign>
36 const_cast<volatile storage_type &
>(
v_) = v;
43 value_type v =
const_cast<const volatile storage_type &
>(
v_);
59 value_type & expected,
69 value_type & expected,
76 storage_type expected_s = (storage_type) expected;
77 storage_type desired_s = (storage_type) desired;
149 template<
typename T,
bool Sign>
163 const_cast<volatile storage_type &
>(
v_) = v;
170 value_type v =
const_cast<const volatile storage_type &
>(
v_);
186 value_type & expected,
196 value_type & expected,
203 storage_type expected_s = (storage_type) expected;
204 storage_type desired_s = (storage_type) desired;
276 template<
typename T,
bool Sign>
289 const_cast<volatile value_type &
>(
v_) = v;
296 value_type v =
const_cast<const volatile value_type &
>(
v_);
312 value_type & expected,
322 value_type & expected,
413 const_cast<volatile value_type &
>(
v_) = v;
420 value_type v =
const_cast<const volatile value_type &
>(
v_);
436 value_type & expected,
446 value_type & expected,
495 template<
typename T,
bool Sign>
508 const_cast<volatile value_type &
>(
v_) = v;
515 value_type v =
const_cast<const volatile value_type &
>(
v_);
531 value_type & expected,
541 value_type & expected,
592 template<
typename T,
bool Sign>
600 memcpy(&
v_, &v,
sizeof(value_type));
607 storage_type tmp = 0;
608 memcpy(&tmp, &v,
sizeof(value_type));
610 const_cast<volatile storage_type &
>(
v_) = tmp;
617 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
621 memcpy(&v, &tmp,
sizeof(value_type));
636 value_type & expected,
646 value_type & expected,
652 storage_type expected_s = 0, desired_s = 0;
653 memcpy(&expected_s, &expected,
sizeof(value_type));
654 memcpy(&desired_s, &desired,
sizeof(value_type));
663 memcpy(&expected, &expected_s,
sizeof(value_type));
682 template<
typename T,
bool Sign>
690 memcpy(&
v_, &v,
sizeof(value_type));
697 storage_type tmp = 0;
698 memcpy(&tmp, &v,
sizeof(value_type));
700 const_cast<volatile storage_type &
>(
v_) = tmp;
707 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
711 memcpy(&v, &tmp,
sizeof(value_type));
726 value_type & expected,
736 value_type & expected,
742 storage_type expected_s = 0, desired_s = 0;
743 memcpy(&expected_s, &expected,
sizeof(value_type));
744 memcpy(&desired_s, &desired,
sizeof(value_type));
753 memcpy(&expected, &expected_s,
sizeof(value_type));
772 template<
typename T,
bool Sign>
780 memcpy(&
v_, &v,
sizeof(value_type));
787 storage_type tmp = 0;
788 memcpy(&tmp, &v,
sizeof(value_type));
790 const_cast<volatile storage_type &
>(
v_) = tmp;
797 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
801 memcpy(&v, &tmp,
sizeof(value_type));
816 value_type & expected,
826 value_type & expected,
832 storage_type expected_s = 0, desired_s = 0;
833 memcpy(&expected_s, &expected,
sizeof(value_type));
834 memcpy(&desired_s, &desired,
sizeof(value_type));
843 memcpy(&expected, &expected_s,
sizeof(value_type));
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_before_store(memory_order order)
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order, memory_order) volatile
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_sub(difference_type v, memory_order order=memory_order_seq_cst) volatile
bool is_lock_free(void) const volatile
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_after_load(memory_order order)
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
ptrdiff_t difference_type
base_atomic(value_type v)
bool is_lock_free(void) const volatile
base_atomic(value_type v)
bool is_lock_free(void) const volatile
bool is_lock_free(void) const volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
base_atomic(value_type v)
value_type load(memory_order order=memory_order_seq_cst) const volatile
static void platform_fence_after_store(memory_order order)
value_type load(memory_order order=memory_order_seq_cst) const volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
bool is_lock_free(void) const volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
bool is_lock_free(void) const volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_add(difference_type v, memory_order order=memory_order_seq_cst) volatile
#define BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
base_atomic(value_type v)
value_type load(memory_order=memory_order_seq_cst) volatileconst
bool platform_cmpxchg32_strong(T &expected, T desired, volatile T *ptr)
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_sub(difference_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_after(memory_order order)
#define BOOST_ATOMIC_DECLARE_BASE_OPERATORS
base_atomic(value_type v)
base_atomic(value_type v)
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
ptrdiff_t difference_type
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool is_lock_free(void) const volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
#define BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
static void platform_fence_before(memory_order order)
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
base_atomic(value_type v)
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(difference_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
void operator=(const base_atomic &)
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
base_atomic(value_type v)
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile
bool is_lock_free(void) const volatile