SDL_TryLockSpinlock - Try to lock a spin lock by setting it to a non-zero value.
Contents
Availability
This function is available since SDL 3.2.0.
Description
Pleasenotethatspinlocksaredangerousifyoudon'tknowwhatyou'redoing.Pleasebecarefulusinganysortofspinlock!
Function Parameters
lock a pointer to a lock variable.
Name
SDL_TryLockSpinlock - Try to lock a spin lock by setting it to a non-zero value.
Return Value
Returns true if the lock succeeded, false if the lock is already held.
See Also
SDL_LockSpinlock(3), SDL_UnlockSpinlock(3) Simple Directmedia Layer SDL 3.2.20 SDL_TryLockSpinlock(3)
Synopsis
#include<SDL3/SDL_atomic.h>boolSDL_TryLockSpinlock(SDL_SpinLock*lock);
Thread Safety
It is safe to call this function from any thread.
