1 #ifndef BOOST_DETAIL_ATOMIC_CAS32WEAK_HPP 2 #define BOOST_DETAIL_ATOMIC_CAS32WEAK_HPP 19 template<
typename T,
bool Sign>
20 class base_atomic<T, int, 1, Sign> {
33 const_cast<volatile storage_type &
>(
v_) = v;
40 value_type v =
const_cast<const volatile storage_type &
>(
v_);
56 value_type & expected,
63 storage_type expected_s = (storage_type) expected;
64 storage_type desired_s = (storage_type) desired;
80 value_type & expected,
86 value_type tmp = expected;
89 if (tmp != expected) {
154 template<
typename T,
bool Sign>
168 const_cast<volatile storage_type &
>(
v_) = v;
175 value_type v =
const_cast<const volatile storage_type &
>(
v_);
191 value_type & expected,
198 storage_type expected_s = (storage_type) expected;
199 storage_type desired_s = (storage_type) desired;
215 value_type & expected,
221 value_type tmp = expected;
224 if (tmp != expected) {
289 template<
typename T,
bool Sign>
302 const_cast<volatile value_type &
>(
v_) = v;
309 value_type v =
const_cast<const volatile value_type &
>(
v_);
325 value_type & expected,
345 value_type & expected,
351 value_type tmp = expected;
354 if (tmp != expected) {
434 const_cast<volatile value_type &
>(
v_) = v;
441 value_type v =
const_cast<const volatile value_type &
>(
v_);
457 value_type & expected,
477 value_type & expected,
483 value_type tmp = expected;
486 if (tmp != expected) {
524 template<
typename T,
bool Sign>
537 const_cast<volatile value_type &
>(
v_) = v;
544 value_type v =
const_cast<const volatile value_type &
>(
v_);
560 value_type & expected,
580 value_type & expected,
586 value_type tmp = expected;
589 if (tmp != expected) {
629 template<
typename T,
bool Sign>
637 memcpy(&
v_, &v,
sizeof(value_type));
644 storage_type tmp = 0;
645 memcpy(&tmp, &v,
sizeof(value_type));
647 const_cast<volatile storage_type &
>(
v_) = tmp;
654 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
658 memcpy(&v, &tmp,
sizeof(value_type));
673 value_type & expected,
678 storage_type expected_s = 0, desired_s = 0;
679 memcpy(&expected_s, &expected,
sizeof(value_type));
680 memcpy(&desired_s, &desired,
sizeof(value_type));
690 memcpy(&expected, &expected_s,
sizeof(value_type));
698 value_type & expected,
704 value_type tmp = expected;
707 if (tmp != expected) {
727 template<
typename T,
bool Sign>
735 memcpy(&
v_, &v,
sizeof(value_type));
742 storage_type tmp = 0;
743 memcpy(&tmp, &v,
sizeof(value_type));
745 const_cast<volatile storage_type &
>(
v_) = tmp;
752 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
756 memcpy(&v, &tmp,
sizeof(value_type));
771 value_type & expected,
776 storage_type expected_s = 0, desired_s = 0;
777 memcpy(&expected_s, &expected,
sizeof(value_type));
778 memcpy(&desired_s, &desired,
sizeof(value_type));
788 memcpy(&expected, &expected_s,
sizeof(value_type));
796 value_type & expected,
802 value_type tmp = expected;
805 if (tmp != expected) {
825 template<
typename T,
bool Sign>
833 memcpy(&
v_, &v,
sizeof(value_type));
840 storage_type tmp = 0;
841 memcpy(&tmp, &v,
sizeof(value_type));
843 const_cast<volatile storage_type &
>(
v_) = tmp;
850 storage_type tmp =
const_cast<const volatile storage_type &
>(
v_);
854 memcpy(&v, &tmp,
sizeof(value_type));
869 value_type & expected,
874 storage_type expected_s = 0, desired_s = 0;
875 memcpy(&expected_s, &expected,
sizeof(value_type));
876 memcpy(&desired_s, &desired,
sizeof(value_type));
886 memcpy(&expected, &expected_s,
sizeof(value_type));
894 value_type & expected,
900 value_type tmp = expected;
903 if (tmp != expected) {
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
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
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 platform_cmpxchg32(T &expected, T desired, volatile T *ptr)
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