开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜