$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [Boost.Thread] Join not waiting?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-10 16:44:25
AMDG
James Auger wrote:
> <snip>
>
> class Example
> {
> public:
>      Example();
>      void run()
>      {
>           flag = 1;
>           boost::thread _myThread(boost::bind(&Example::threadLoop, this));
>      };
>   
You are creating a new boost::thread which is completely unrelated to
the member _myThread.  Try
_myThread = boost::thread(boost::bind(&Example::threadLoop, this));
>      void terminate();
>
> private:
>      void threadLoop();
>
>      boost::thread _myThread;
>      int flag;
> };
>   
In Christ,
Steven Watanabe