1#ifndef SDL3PP_ATOMIC_H_
2#define SDL3PP_ATOMIC_H_
4#include <SDL3/SDL_atomic.h>
5#include "SDL3pp_stdinc.h"
109#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
147#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
170#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
188#define SDL_CPUPauseInstruction() \
189 DoACPUPauseInACompilerAndArchitectureSpecificWay
362 return SDL_CompareAndSwapAtomicInt(a, oldval, newval);
390 return SDL_SetAtomicInt(a, v);
435 return SDL_AddAtomicInt(a, v);
668 return SDL_CompareAndSwapAtomicU32(a, oldval, newval);
696 return SDL_SetAtomicU32(a, v);
723 return SDL_CompareAndSwapAtomicPointer(&m_value, oldval, newval);
729 return SDL_SetAtomicPointer(&m_value, v);
735 return SDL_GetAtomicPointer(&m_value);
Definition: SDL3pp_atomic.h:576
constexpr AtomicPointer(T *value)
Construcst from T.
Definition: SDL3pp_atomic.h:581
SDL_AtomicU32 AtomicU32Raw
Alias to raw representation for AtomicU32.
Definition: SDL3pp_atomic.h:46
bool CompareAndSwap(Uint32 oldval, Uint32 newval)
Set an atomic variable to a new value if it is currently an old value.
Definition: SDL3pp_atomic.h:671
bool CompareAndSwap(int oldval, int newval)
Set an atomic variable to a new value if it is currently an old value.
Definition: SDL3pp_atomic.h:365
T * Get()
Get the value of a pointer atomically.
Definition: SDL3pp_atomic.h:733
int Add(int v)
Add to an atomic variable.
Definition: SDL3pp_atomic.h:438
bool AtomicIncRef(AtomicIntRaw *a)
Increment an atomic variable used as a reference count.
Definition: SDL3pp_atomic.h:454
T * Set(T *v)
Set a pointer to a value atomically.
Definition: SDL3pp_atomic.h:727
bool AtomicDecRef()
Decrement an atomic variable used as a reference count.
Definition: SDL3pp_atomic.h:475
int GetAtomicInt(AtomicIntRaw *a)
Get the value of an atomic variable.
Definition: SDL3pp_atomic.h:410
bool AtomicDecRef(AtomicIntRaw *a)
Decrement an atomic variable used as a reference count.
Definition: SDL3pp_atomic.h:473
SDL_AtomicInt AtomicIntRaw
Alias to raw representation for AtomicInt.
Definition: SDL3pp_atomic.h:40
Uint32 Set(Uint32 v)
Set an atomic variable to a value.
Definition: SDL3pp_atomic.h:699
int Get()
Get the value of an atomic variable.
Definition: SDL3pp_atomic.h:412
Uint32 GetAtomicU32(AtomicU32Raw *a)
Get the value of an atomic variable.
Definition: SDL3pp_atomic.h:716
Uint32 SetAtomicU32(AtomicU32Raw *a, Uint32 v)
Set an atomic variable to a value.
Definition: SDL3pp_atomic.h:694
bool CompareAndSwap(T *oldval, T *newval)
Set a pointer to a new value if it is currently an old value.
Definition: SDL3pp_atomic.h:721
bool AtomicIncRef()
Increment an atomic variable used as a reference count.
Definition: SDL3pp_atomic.h:456
int SetAtomicInt(AtomicIntRaw *a, int v)
Set an atomic variable to a value.
Definition: SDL3pp_atomic.h:388
int Set(int v)
Set an atomic variable to a value.
Definition: SDL3pp_atomic.h:393
void MemoryBarrierAcquire()
Insert a memory acquire barrier (function version).
Definition: SDL3pp_atomic.h:89
bool CompareAndSwapAtomicInt(AtomicIntRaw *a, int oldval, int newval)
Set an atomic variable to a new value if it is currently an old value.
Definition: SDL3pp_atomic.h:360
void MemoryBarrierRelease()
Insert a memory release barrier (function version).
Definition: SDL3pp_atomic.h:69
Uint32 Get()
Get the value of an atomic variable.
Definition: SDL3pp_atomic.h:718
bool CompareAndSwapAtomicU32(AtomicU32Raw *a, Uint32 oldval, Uint32 newval)
Set an atomic variable to a new value if it is currently an old value.
Definition: SDL3pp_atomic.h:664
int AddAtomicInt(AtomicIntRaw *a, int v)
Add to an atomic variable.
Definition: SDL3pp_atomic.h:433
Uint32 Uint32
An unsigned 32-bit integer type.
Definition: SDL3pp_stdinc.h:328
Main include header for the SDL3pp library.
A type representing an atomic integer value.
Definition: SDL3pp_atomic.h:221
constexpr AtomicInt(int value)
Wraps AtomicInt.
Definition: SDL3pp_atomic.h:227
A type representing an atomic unsigned 32-bit value.
Definition: SDL3pp_atomic.h:504
constexpr AtomicU32(Uint32 value)
Wraps value.
Definition: SDL3pp_atomic.h:510