I need to access the thread ID from threads that I don\'t control (it\'s in an asynchronous callback function, and it get called from a set of different threads).
I
Why not using thread local storage? http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_local_storage.html