Returns the thread identifier for the calling thread.
#include <pthread.h> pthread_t pthread_self ( void );
Returns the thread identifier of the calling thread.
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.