sdlLockSpinlock function

void sdlLockSpinlock(
  1. Pointer<Int32> lock
)

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!

\param lock a pointer to a lock variable.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_TryLockSpinlock \sa SDL_UnlockSpinlock

extern SDL_DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock)

Implementation

void sdlLockSpinlock(Pointer<Int32> lock) {
  final sdlLockSpinlockLookupFunction = libSdl3.lookupFunction<
      Void Function(Pointer<Int32> lock),
      void Function(Pointer<Int32> lock)>('SDL_LockSpinlock');
  return sdlLockSpinlockLookupFunction(lock);
}