SDL_TryLockSpinlock

Try to lock a spin lock by setting it to a non-zero value.

***Please note that spinlocks are dangerous if you don't know what you're doing. Please be careful using any sort of spinlock!***

extern (C) nothrow @nogc extern
bool
SDL_TryLockSpinlock

Parameters

lock SDL_SpinLock*

a pointer to a lock variable.

Return Value

Type: bool

true if the lock succeeded, false if the lock is already held.

See Also

SDL_LockSpinlock SDL_UnlockSpinlock

Threadsafety: It is safe to call this function from any thread.

Meta

History

Available since SDL 3.2.0.