multithreading - Getting a reference to the current boost::thread/interrupting the main thread -


i trying reference main boost::thread of execution, can interrupt it. however, boost::thread doesn't seem supply way of doing this.

i have searched on internet can't seem find answer question.
did see old answers, seem relevant old boost code.
closest 1 said using boost::thread t; (the default constructor) give me reference current thread. however, boost documentation seems that create reference not-a-thread.

my main goal interrupt main thread, , not reference current boost::thread, seemed easiest way.

my current solution create new thread main, , join() it. there way current thread object (or interrupt it) , not use workaround?

thanks

a default constructed boost::thread object used (in v1.34 , earlier) refer current thread, not longer.

you cannot interrupt main thread in boost. workaround of starting new thread work, , joining main() best way.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -