logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Availability

       This function is available since SDL 3.2.0.

Description

Note:Ifyoudon'tknowwhatthisfunctionisfor,youshouldn'tuseit!

Function Parameters

a      a pointer to an SDL_AtomicInt variable to be modified.

       oldval the old value.

       newval the new value.

Name

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

Return Value

       Returns true if the atomic variable was set, false otherwise.

See Also

SDL_GetAtomicInt(3), SDL_SetAtomicInt(3)

Simple Directmedia Layer                           SDL 3.2.20                     SDL_CompareAndSwapAtomicInt(3)

Synopsis

#include<SDL3/SDL_atomic.h>boolSDL_CompareAndSwapAtomicInt(SDL_AtomicInt*a,intoldval,intnewval);

Thread Safety

       It is safe to call this function from any thread.

See Also