10 : m_Value(static_cast<UnderlyingType>(value))
127PL_ALWAYS_INLINE plAtomicBool::~plAtomicBool() =
default;
136 Set(
static_cast<bool>(rhs));
141 return m_iAtomicInt.
Set(value ? 1 : 0) != 0;
151 Set(
static_cast<bool>(rhs));
154PL_ALWAYS_INLINE plAtomicBool::operator bool()
const
156 return static_cast<plInt32
>(m_iAtomicInt) != 0;
161 return m_iAtomicInt.
TestAndSet(bExpected ? 1 : 0, bNewValue ? 1 : 0) != 0;
An atomic boolean variable. This is just a wrapper around an atomic int32 for convenience.
Definition AtomicInteger.h:100
bool Set(bool value)
Sets the bool to the given value and returns its previous value.
Definition AtomicInteger_inl.h:139
plAtomicBool()
Initializes the bool to 'false'.
void operator=(bool value)
Sets the bool to the given value.
Definition AtomicInteger_inl.h:144
bool TestAndSet(bool bExpected, bool bNewValue)
Sets the internal value to newValue if the internal value is equal to expected and returns true,...
Definition AtomicInteger_inl.h:159
Integer class that can be manipulated in an atomic (i.e. thread-safe) fashion.
Definition AtomicInteger.h:39
bool TestAndSet(T expected, T x)
Sets the internal value to x if the internal value is equal to expected and returns true,...
Definition AtomicInteger_inl.h:107
T Increment()
Increments the internal value and returns the incremented value.
Definition AtomicInteger_inl.h:35
plAtomicInteger & operator=(T value)
Assigns a new integer value to this object.
Definition AtomicInteger_inl.h:21
T PostDecrement()
Decrements the internal value and returns the value immediately before the decrement.
Definition AtomicInteger_inl.h:53
T Decrement()
Decrements the internal value and returns the decremented value.
Definition AtomicInteger_inl.h:41
T Set(T x)
Sets the internal value to x and returns the original internal value.
Definition AtomicInteger_inl.h:101
T PostIncrement()
Increments the internal value and returns the value immediately before the increment.
Definition AtomicInteger_inl.h:47
T CompareAndSwap(T expected, T x)
If this is equal to expected, it is set to value. Otherwise it won't be modified. Always returns the ...
Definition AtomicInteger_inl.h:113
plAtomicInteger()
Initializes the value to zero.
Definition AtomicInteger_inl.h:3
This class provides functions to do atomic operations.
Definition AtomicUtils.h:15
static plInt32 Decrement(plInt32 &ref_iDest)
Decrements dest as an atomic operation and returns the new value.
Definition AtomicUtils_posix.h:31
static void Add(plInt32 &ref_iDest, plInt32 value)
Adds value to dest as an atomic operation.
Definition AtomicUtils_posix.h:62
static plInt32 CompareAndSwap(plInt32 &ref_iDest, plInt32 iExpected, plInt32 value)
If dest is equal to expected, this function sets dest to value. Otherwise dest will not be modified....
Definition AtomicUtils_posix.h:192
static void Or(plInt32 &ref_iDest, plInt32 value)
Performs an atomic bitwise OR on dest using value.
Definition AtomicUtils_posix.h:84
static plInt32 Read(const plInt32 &iSrc)
Returns src as an atomic operation and returns its value.
Definition AtomicUtils_posix.h:10
static void Min(plInt32 &ref_iDest, plInt32 value)
Performs an atomic min operation on dest using value.
Definition AtomicUtils_posix.h:106
static void And(plInt32 &ref_iDest, plInt32 value)
Performs an atomic bitwise AND on dest using value.
Definition AtomicUtils_posix.h:73
static void Xor(plInt32 &ref_iDest, plInt32 value)
Performs an atomic bitwise XOR on dest using value.
Definition AtomicUtils_posix.h:95
static plInt32 PostIncrement(plInt32 &ref_iDest)
Increments dest as an atomic operation and returns the old value.
Definition AtomicUtils_posix.h:41
static plInt32 Increment(plInt32 &ref_iDest)
Increments dest as an atomic operation and returns the new value.
Definition AtomicUtils_posix.h:20
static void Max(plInt32 &ref_iDest, plInt32 value)
Performs an atomic max operation on dest using value.
Definition AtomicUtils_posix.h:133
static plInt32 PostDecrement(plInt32 &ref_iDest)
Decrements dest as an atomic operation and returns the old value.
Definition AtomicUtils_posix.h:52
static plInt32 Set(plInt32 &ref_iDest, plInt32 value)
Sets dest to value as an atomic operation and returns the original value of dest.
Definition AtomicUtils_posix.h:160
static bool TestAndSet(plInt32 &ref_iDest, plInt32 iExpected, plInt32 value)
If dest is equal to expected, this function sets dest to value and returns true. Otherwise dest will ...
Definition AtomicUtils_posix.h:171