SDL_CompareAndSwapAtomicInt

Set an atomic variable to a new value if it is currently an old value.

***Note: If you don't know what this function is for, you shouldn't use it!***

extern (C) nothrow @nogc extern
bool
SDL_CompareAndSwapAtomicInt

Parameters

a SDL_AtomicInt*

a pointer to an SDL_AtomicInt variable to be modified.

oldval int

the old value.

newval int

the new value.

Return Value

Type: bool

true if the atomic variable was set, false otherwise.

See Also

SDL_GetAtomicInt SDL_SetAtomicInt

Threadsafety: It is safe to call this function from any thread.

Meta

History

Available since SDL 3.2.0.