SDL_CompareAndSwapAtomicPointer - Set a pointer to a new value if it is currently an old value.
Contents
Availability
This function is available since SDL 3.2.0.
Description
Note:Ifyoudon'tknowwhatthisfunctionisfor,youshouldn'tuseit!
Function Parameters
a a pointer to a pointer.
oldval the old pointer value.
newval the new pointer value.
Name
SDL_CompareAndSwapAtomicPointer - Set a pointer to a new value if it is currently an old value.
Return Value
Returns true if the pointer was set, false otherwise.
See Also
SDL_CompareAndSwapAtomicInt(3), SDL_GetAtomicPointer(3), SDL_SetAtomicPointer(3) Simple Directmedia Layer SDL 3.2.20 SDL_CompareAndSwapAtomicPointer(3)
Synopsis
#include<SDL3/SDL_atomic.h>boolSDL_CompareAndSwapAtomicPointer(void**a,void*oldval,void*newval);
Thread Safety
It is safe to call this function from any thread.
