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_SpinLock - An atomic spinlock.

Description

       The atomic locks are efficient spinlocks using CPU instructions, but are vulnerable to starvation and can
       spin forever if a thread holding a lock has been terminated. For this reason you should minimize the code
       executed inside an atomic lock and never do expensive things like API or system calls while holding them.

       They  are  also  vulnerable  to  starvation  if  the thread holding the lock is lower priority than other
       threads and doesn't get scheduled. In general you should use mutexes  instead,  since  they  have  better
       performance and contention behavior.

       The atomic locks are not safe to lock recursively.

       Porting Note: The spin lock functions and type are required and can not be emulated because they are used
       in the atomic emulation code.

Simple Directmedia Layer                           SDL 3.2.10                                SDL_SpinLock(3type)

Header File

       Defined in SDL3/SDL_atomic.h

Name

       SDL_SpinLock - An atomic spinlock.

Synopsis

#include"SDL3/SDL.h"typedefintSDL_SpinLock;

See Also