|
Boost : |
Subject: Re: [boost] [thread] ~condition_variable_any verifications
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-02-22 12:54:33
Le 22/02/13 18:41, Vicente J. Botet Escriba a écrit :
> Le 22/02/13 17:17, Tim Blechmann a écrit :
>> hi,
>>
>> one of my project uses exit() to terminate the program. this is
>> sometimes called while some threads are waiting on a global
>> condition_variable_any.
>>
>> when calling exit(), this global variable is destroyed while other
>> threads are still waiting on it, which causes BOOST_VERIFY to fire an
>> assertion failure !pthread_cond_destroy(&cond). this scares the hell out
>> of my users.
>>
>> i know that these verifications can be really useful in many case, but
>> in my use case, it makes exit() rather unusable, and i'd have to
>> redesign some of the internal logic to avoid this assertion failure.
>>
>> thoughts?
>
> Which alternative behavior would you expect?
I don't know what the standard says about this, but I suspect that you
should add a exit handle to join all your threads.
Best,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk