Returns the thread identifier for the calling thread.
#include <thread.h> thread_t thr_self ( void );
Returns the 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.