Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2003-12-16 07:27:32


Pavel Vozenilek wrote:

> "Michael Glassford" <glassfordm_at_[hidden]> wrote
>
>
>>I could manage some bug fixes, ...
>>
>
> Yes please.
>
> Here's very trivial bugfix for call_once():
> http://aspn.activestate.com/ASPN/Mail/Message/boost/1694065

I assume you're referring to this part:

> Looking into the code, I have question: if the 'called once'
> function throws, it leaves (under Win32) opened mutex and
> this can deadlock the app (if there are more functions to
> be 'called once').
>
> The mutex can be closed even in this case and function
> flagged as executed.

I agree that the mutex needs to be released if an exception is thrown.
This leads back to my original "what's the procedure?" question. I
suppose I should make the proposed change and post a patch?

One other potential problem that needs to be addressed in the same
section of code: if the "called once" function throws an exception,
should the flag indicating that it has been called be set or not? If the
flag is set, the function will not be called again even though it
failed; on the other hand, if the flag is is not set, the function may
continue to be called and continue to throw an exception. What does the
pthread implementation do in this case?

> /Pavel
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk