3#include <Foundation/Types/TypeTraits.h>
5#include <Foundation/Threading/AtomicUtils.h>
43 PL_DECLARE_POD_TYPE();
95 UnderlyingType m_Value;
113 bool Set(
bool value);
122 operator bool()
const;
126 bool TestAndSet(
bool bExpected,
bool bNewValue);
133#include <Foundation/Threading/Implementation/AtomicInteger_inl.h>
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
Definition AtomicInteger.h:9