commit d92f9546e6ae27c180761290d644e7959570e444 parent c50543adf4285c716c31f3bb639ff27fe28dc1bf Author: Michael Savage <mikejsavage@gmail.com> Date: Thu Sep 15 01:59:37 +0100 compare_swap_strong -> compare_exchange_strong Diffstat:
platform_atomic.h | | | 12 | ++++++------ |
diff --git a/platform_atomic.h b/platform_atomic.h @@ -96,28 +96,28 @@ struct atomic_u64 { #define store_relaxed( atom, x ) ( atom )->store( x, std::memory_order_relaxed ) #define fetch_add_relaxed( atom, x ) ( atom )->fetch_add( x, std::memory_order_relaxed ) #define exchange_relaxed( atom, x ) ( atom )->exchange( x, std::memory_order_relaxed ) -// TODO: check compare_swap_strong updates before to be consistent w/ the c11 version -#define compare_exchange_relaxed( atom, before, after ) ( atom )->compare_swap_strong( before, after, std::memory_order_relaxed, std::memory_order_relaxed ) +// TODO: check compare_exchange_strong updates before to be consistent w/ the c11 version +#define compare_exchange_relaxed( atom, before, after ) ( atom )->compare_exchange_strong( before, after, std::memory_order_relaxed, std::memory_order_relaxed ) #define load_acquire( atom ) ( atom )->load( std::memory_order_acquire ) #define fetch_add_acquire( atom, x ) ( atom )->fetch_add( x, std::memory_order_acquire ) #define exchange_acquire( atom, x ) ( atom )->exchange( x, std::memory_order_acquire ) -#define compare_exchange_acquire( atom, before, after ) ( atom )->compare_swap_strong( before, after, std::memory_order_acquire, std::memory_order_acquire ) +#define compare_exchange_acquire( atom, before, after ) ( atom )->compare_exchange_strong( before, after, std::memory_order_acquire, std::memory_order_acquire ) #define store_release( atom, x ) ( atom )->store( x, std::memory_order_release ) #define fetch_add_release( atom, x ) ( atom )->fetch_add( x, std::memory_order_release ) #define exchange_release( atom, x ) ( atom )->exchange( x, std::memory_order_release ) -#define compare_exchange_release( atom, before, after ) ( atom )->compare_swap_strong( before, after, std::memory_order_release, std::memory_order_relaxed ) +#define compare_exchange_release( atom, before, after ) ( atom )->compare_exchange_strong( before, after, std::memory_order_release, std::memory_order_relaxed ) #define fetch_add_acqrel( atom, x ) ( atom )->fetch_add( x, std::memory_order_acq_rel ) #define exchange_acqrel( atom, x ) ( atom )->exchange( x, std::memory_order_acq_rel ) -#define compare_exchange_acqrel( atom, before, after ) ( atom )->compare_swap_strong( before, after, std::memory_order_acq_rel, std::memory_order_acquire ) +#define compare_exchange_acqrel( atom, before, after ) ( atom )->compare_exchange_strong( before, after, std::memory_order_acq_rel, std::memory_order_acquire ) #define load_seqcst( atom ) ( atom )->load( std::memory_order_seq_cst ) #define store_seqcst( atom, x ) ( atom )->store( x, std::memory_order_seq_cst ) #define fetch_add_seqcst( atom, x ) ( atom )->fetch_add( x, std::memory_order_seq_cst ) #define exchange_seqcst( atom, x ) ( atom )->exchange( x, std::memory_order_seq_cst ) -#define compare_exchange_seqcst( atom, before, after ) ( atom )->compare_swap_strong( before, after, std::memory_order_seq_cst, std::memory_order_seq_cst ) +#define compare_exchange_seqcst( atom, before, after ) ( atom )->compare_exchange_strong( before, after, std::memory_order_seq_cst, std::memory_order_seq_cst ) // relacy requires C++98 which doesn't have static_assert // TODO: maybe this should go somewhere else?