sdlGetCurrentThreadId function

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.

\since This function is available since SDL 3.1.3.

\sa SDL_GetThreadID

extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void)

Implementation

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