pthread_self

Returns the thread identifier for the calling thread.

Library:LibC
Classification:POSIX
Service:Threads

Syntax

  #include <pthread.h>
   
  pthread_t pthread_self ( void );
  

Return Values

Returns the thread identifier of the calling thread.

Remarks

The thread ID is unique to the process and is not a system-wide unique ID. To get a system-wide ID, you can combine the thread ID with the process ID.

See Also