Boost logo

Boost Users :

Subject: Re: [Boost-users] [thread] boost::thread automatically detached when thread terminates?
From: Boris Schaeling (boris_at_[hidden])
Date: 2010-09-12 08:55:30


On Sun, 12 Sep 2010 14:44:42 +0200, Eric J. Holtman <eric_at_[hidden]>
wrote:

> On 9/12/2010 7:39 AM, Boris Schaeling wrote:
>>
>> Thanks for your reply! Do you know whether the thread of execution is
>> allowed to call boost::thread::detach()? Then it could detach itself
>> from the boost::thread object before it terminates and
>> boost::thread::joinable() should work? I'm not sure though if
>> boost::thread is thread-safe?
>>
>
> What are you trying to accomplish?

I want a worker thread to terminate if there is nothing to do. If there is
something to do again and the worker thread has terminated I need to
create a new one. Now I wonder if I can use boost::thread to detect
whether the thread is running or not.

Boris


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