Is there any universal solution to recover a pthread_t value for current thread context?
The code is required for a loadable .so for multithreaded app, so I want to somehow receive library’s thread id to understand this thing better – using gdb (details at this question).
The app may utilize Boost, GLib, thousand of other pthreads wrappers – I don’t care, just need the actual thread ID without modifying app’s source.
Yes – just call
pthread_self()to get thepthread_tfor the current thread.