SDL_TryLockSpinlock - Man Page
Try to lock a spin lock by setting it to a non-zero value.
Header File
Defined in SDL3/SDL_atomic.h
Synopsis
#include "SDL3/SDL.h" bool SDL_TryLockSpinlock(SDL_SpinLock *lock);
Description
Please note that spinlocks are dangerous if you don't know what you're doing. Please be careful using any sort of spinlock!
Function Parameters
- lock
a pointer to a lock variable.
Return Value
Returns true if the lock succeeded, false if the lock is already held.
Thread Safety
It is safe to call this function from any thread.
Availability
This function is available since SDL 3.2.0.
See Also
·(3), SDL_LockSpinlock(3), ·(3), SDL_UnlockSpinlock(3)
Referenced By
SDL_LockSpinlock(3), SDL_UnlockSpinlock(3).
SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS