[thread] boost::this_thread::get_id causing interrupt
Hi everyone, I've been dipping my toes into boost threads, and I'm running into a strange issue. What I'm trying to do is to run a comparison between thread_ids. I have an object that's "owned" by a thread, and when something calls one of its functions, I'd like to compare the thread_id to the owner's thread id. So I thought that boost::this_thread::get_id would do the trick to figure out what the current running thread's thread id is. For some reason, when I call it, an interrupt is signalled to my main thread. Is boost::this_thread::get_id not the right thing to use here? Thanks in advance, Yi
I found a solution, which was to use pthread_self instead. If anyone
more familiar with boost thread could tell me why the original code
didn't work, it'd be much appreciated.
On Mon, Aug 15, 2011 at 8:43 AM, Yi Ding
Hi everyone,
I've been dipping my toes into boost threads, and I'm running into a strange issue. What I'm trying to do is to run a comparison between thread_ids. I have an object that's "owned" by a thread, and when something calls one of its functions, I'd like to compare the thread_id to the owner's thread id. So I thought that boost::this_thread::get_id would do the trick to figure out what the current running thread's thread id is. For some reason, when I call it, an interrupt is signalled to my main thread. Is boost::this_thread::get_id not the right thing to use here?
Thanks in advance, Yi
participants (1)
-
Yi Ding