folly::AtomicStruct

AtomicStruct<T> work like C++ atomics, but can be used on any POD type <= 8 bytes.

Synopsis

Declared in <folly/synchronization/AtomicStruct.h>

template<
    typename T,
    template<typename> typename Atom = atomic>
class AtomicStruct;

Member Functions

NameDescription
AtomicStruct [constructor]Constructors
~AtomicStruct [destructor]Destroys the atomic.
operator= Assignment operators
compare_exchange_strong Atomically compares and, on match, replaces the stored value.
compare_exchange_weak Atomically compares and, on match, replaces the stored value; may fail spuriously.
exchange Atomically replaces the stored value and returns the previous one.
is_lock_free Checks whether the atomic operations are lock-free.
load Atomically loads the stored value.
store Atomically stores a new value.
operator T Converts to the stored value with sequentially consistent ordering.