Wiki Page Content

SDL_AtomicLock

Syntax

voidSDL_AtomicLock(SDL_SpinLock*lock)

Function Parameters

lock

a pointer to a lock variable

Code Examples

Youcanaddyourcodeexamplehere

Remarks

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.