I need to know the identity of the current thread to keep track of which threads are making certain requests to a shared data structure.
views:
52answers:
2
+1
Q:
In a multithreaded c++ program using boost, is there any way to get a pointer to the current thread?
+6
A:
You can use boost::this_thread::get_id()
to get a boost::thread::id
representing the thread.
I don't think you can get a pointer to a boost::thread
object, because the thread doesn't necessarily have one attached. And it cannot make one because it might have one attached.
GMan
2010-10-15 19:27:38