SDL_CompareAndSwapAtomicU32

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_CompareAndSwapAtomicU32

Parameters

a SDL_AtomicU32*

a pointer to an SDL_AtomicU32 variable to be modified.

oldval Uint32

the old value.

newval Uint32

the new value.

Return Value

Type: bool

true if the atomic variable was set, false otherwise.

See Also

SDL_GetAtomicU32 SDL_SetAtomicU32

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

Meta

History

Available since SDL 3.2.0.