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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
boost::this_thread::get_id()to get aboost::thread::idrepresenting the thread.I don’t think you can get a pointer to a
boost::threadobject, because the thread doesn’t necessarily have one attached. And it cannot make one because it might have one attached.