header file: pthread.h
pthread_t pthread_self(void);
header file: Windows.h
DWORD WINAPI GetCurrentThreadId(void);
The pthread_self function is used to obtain the id of the
calling thread.
In the Windows threading model each created thread has both a
HANDLE and a system-wide unique id. As a result the
GetCurrentThreadId Windows function returns the same logical
information as the POSIX call.