$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: hlh771
Date: 2003-01-09 21:51:11
How to stop(or cancel) a thread? Suppose I have a main thread and a
worker thread, the worker thread does something looply,and when the
main thread get a message indicating the process should exit, I want
stop the worker thread,how to do that?I have read other thread
library,their thread class supply a method called stop or cancel
which stops the thread. Their Implementation is:the thread class has
a data member indicating whether the thread should stop,and the
thread function looply check the data member whether the thread
should stop.Generally the data member's type is a bool or Event.
Is it the best way to stop the thread? How the boost to deal with
this?
Thanks in advance.