sdlWaitSemaphore function mutex

void sdlWaitSemaphore(
  1. Pointer<SdlSemaphore> sem
)

Wait until a semaphore has a positive value and then decrements it.

This function suspends the calling thread until the semaphore pointed to by sem has a positive value, and then atomically decrement the semaphore value.

This function is the equivalent of calling SDL_WaitSemaphoreTimeout() with a time length of -1.

\param sem the semaphore wait on.

\since This function is available since SDL 3.2.0.

\sa SDL_SignalSemaphore \sa SDL_TryWaitSemaphore \sa SDL_WaitSemaphoreTimeout

extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem)

Implementation

void sdlWaitSemaphore(Pointer<SdlSemaphore> sem) {
  final sdlWaitSemaphoreLookupFunction = _libSdl
      .lookupFunction<
        Void Function(Pointer<SdlSemaphore> sem),
        void Function(Pointer<SdlSemaphore> sem)
      >('SDL_WaitSemaphore');
  return sdlWaitSemaphoreLookupFunction(sem);
}