sdlCreateMutex function

Pointer<SdlMutex> sdlCreateMutex()

Create a new mutex.

All newly-created mutexes begin in the unlocked state.

Calls to SDL_LockMutex() will not return while the mutex is locked by another thread. See SDL_TryLockMutex() to attempt to lock without blocking.

SDL mutexes are reentrant.

\returns the initialized and unlocked mutex or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_DestroyMutex \sa SDL_LockMutex \sa SDL_TryLockMutex \sa SDL_UnlockMutex

extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void)

Implementation

Pointer<SdlMutex> sdlCreateMutex() {
  final sdlCreateMutexLookupFunction = libSdl2.lookupFunction<
      Pointer<SdlMutex> Function(),
      Pointer<SdlMutex> Function()>('SDL_CreateMutex');
  return sdlCreateMutexLookupFunction();
}