开发者

Recover pthread context (thread id) in Linux

开发者 https://www.devze.com 2023-03-16 23:43 出处:网络
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

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

精彩评论

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