sdlGetCurrentThreadId function thread

int sdlGetCurrentThreadId()

Get the thread identifier for the current thread.

This thread identifier is as reported by the underlying operating system. If SDL is running on a platform that does not support threads the return value will always be zero.

This function also returns a valid thread ID when called from the main thread.

\returns the ID of the current thread.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetThreadID

extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void)

Implementation

int sdlGetCurrentThreadId() {
  final sdlGetCurrentThreadIdLookupFunction = _libSdl
      .lookupFunction<Uint64 Function(), int Function()>(
        'SDL_GetCurrentThreadID',
      );
  return sdlGetCurrentThreadIdLookupFunction();
}