I have one problem, I need to terminate boost thread. And do this from main thread. Using a flag is not suitable. Please help me. I need windows solution.
Asked
Active
Viewed 1,942 times
1
-
What do you mean by "Use the flag is not suitable."? – CB Bailey Oct 15 '12 at 10:42
-
Did you try with [thread::interrupt()](http://www.boost.org/doc/libs/1_41_0/doc/html/thread/thread_management.html#thread.thread_management.thread.interrupt)? – Adriano Repetti Oct 15 '12 at 10:45
-
Always terminate threads cooperatively. Trying to forcefully abort a thread is dangerous in C++. – Branko Dimitrijevic Oct 15 '12 at 10:45
1 Answers
4
Please, read the answer to the following question.
If nevertheless you must terminate thread on Windows, you can do that like this: TerminateThread(yourThread.native_handle());