I have multiple threads running (pthreads api), each with it’s own timer that calls a function handler(int signum) after a certain interval. As these threads call handler and within the function handler, how do I know which thread called it? Is thread-specific data required?
I have multiple threads running (pthreads api), each with it’s own timer that calls
Share
You can use the
pthread_self()function to have the ID of the current thread.