40template <
typename Type>
57 #if __cpp_lib_atomic_is_always_lock_free
58 static_assert (std::atomic<Type>::is_always_lock_free,
59 "This class can only be used for lock-free types");
67 void set (Type newValue)
noexcept {
value = newValue; }
70 Type
exchange (Type newValue)
noexcept {
return value.exchange (newValue); }
98 return value.compare_exchange_strong (valueToCompare, newValue);
104 value = other.value.load();
116 Type operator+= (
DiffType amountToAdd)
noexcept {
return value += amountToAdd; }
119 Type operator-= (
DiffType amountToSubtract)
noexcept {
return value -= amountToSubtract; }
139 [[deprecated (
"This method has been deprecated as there is no equivalent method in "
140 "std::atomic. Use compareAndSetBool instead.")]]
#define noexcept
Definition DistrhoDefines.h:72
#define final
Definition DistrhoDefines.h:74
static PuglViewHint int value
Definition pugl.h:1708
Definition juce_Atomic.h:28
Definition carla_juce.cpp:31
std::ptrdiff_t Type
Definition juce_Atomic.h:30
Definition juce_Atomic.h:29
T Type
Definition juce_Atomic.h:29
Type get() const noexcept
Definition juce_Atomic.h:64
Type compareAndSetValue(Type, Type) noexcept
Type exchange(Type newValue) noexcept
Definition juce_Atomic.h:70
Atomic(Type initialValue) noexcept
Definition juce_Atomic.h:49
void set(Type newValue) noexcept
Definition juce_Atomic.h:67
Atomic() noexcept
Definition juce_Atomic.h:46
std::atomic< Type > value
Definition juce_Atomic.h:135
typename AtomicHelpers::DiffTypeHelper< Type >::Type DiffType
Definition juce_Atomic.h:43
bool compareAndSetBool(Type newValue, Type valueToCompare) noexcept
Definition juce_Atomic.h:96
Type operator--() noexcept
Definition juce_Atomic.h:125
~Atomic() noexcept
Definition juce_Atomic.h:55
void memoryBarrier() noexcept
Definition juce_Atomic.h:132
Type operator++() noexcept
Definition juce_Atomic.h:122
Atomic(const Atomic &other) noexcept
Definition juce_Atomic.h:52
#define const
Definition zconf.h:137