Recover pthread context (thread id) in Linux
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, ju开发者_如何学运维st need the actual thread ID without modifying app's source.
Yes - just call pthread_self()
to get the pthread_t
for the current thread.
精彩评论