GetCurrentThreadId function

Retrieves the thread identifier of the calling thread.

Syntax

DWORD GetCurrentThreadId(

);

Parameters

This function has no parameters.

Return Value

The return value is the thread identifier of the calling thread.

Remarks

Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system.

Examples

For an example, see Using Thread Local Storage.

Requirements

   
Windows version Windows XP [desktop apps | UWP apps] Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header processthreadsapi.h (include Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008 Windows Server 2008 R2, Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

GetCurrentThread

OpenThread

Process and Thread Functions

Threads