Boost logo

Boost Users :

Subject: Re: [Boost-users] Creating a thread and blocking its execution
From: Andrew Holden (aholden_at_[hidden])
Date: 2010-08-31 16:01:41


On Tuesday, August 31, 2010 1:31 PM, Jean-Sebastien Stoezel wrote:
> Hello,
>
> I use boost::thread as follow:
>
> mp_Thread = new boost::thread(boost::bind(CSubsystem::TaskWrapper,
this));
>
> to create a thread in an initialization method. I observe that this
thread
> gets to run before my initialization method has completed its
execution.
>
> I would like to create a thread from this initialization method, and
wait
> for it to execute until the whole initialization process it done.
> Is it possible to create a thread in suspended mode, and then release
it
> once the system is ready? Or do I need to use a synchronization
mechanism
> like a semaphore to release it?
>
> Jean-Sebastien

What prevents you from creating the thread as the last step in your
initialization method?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net