sdlGetThreadId function

int sdlGetThreadId(
  1. Pointer<SdlThread> thread
)

Get the thread identifier for the specified 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.

\param thread the thread to query. \returns the ID of the specified thread, or the ID of the current thread if thread is NULL.

\since This function is available since SDL 3.1.3.

\sa SDL_GetCurrentThreadID

extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread)

Implementation

int sdlGetThreadId(Pointer<SdlThread> thread) {
  final sdlGetThreadIdLookupFunction = libSdl3.lookupFunction<
      Uint64 Function(Pointer<SdlThread> thread),
      int Function(Pointer<SdlThread> thread)>('SDL_GetThreadID');
  return sdlGetThreadIdLookupFunction(thread);
}