Boost logo

Boost :

Subject: [boost] Boost sprint: #3407 boost::call_once not re-entrant (at least in win32)
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2009-11-22 11:49:39


Hi,

I have changed the ticket from threads to thread

As this works as expected, Anthony could just add on the documentation why
reentrant call_once functions are not a good idea. The explanation of Steven
could be a good starting point:

"I'll also point out that there is no good behavior for a recursive call to
call_once. If it calls the function again, then f will be called twice. If
it does not, then whatever initialization that call_once is doing may be
incomplete. In either case, you have to know whether a call can be recursive
and carefully design for it. If it happens accidentally, you're probably
toast regardless of how it behaves. In the face of recursive calls it is
impossible to maintain the post-condition that the function has run exactly
once."

After this modification IMO the ticket can be closed.

Best,
Vicente

-- 
View this message in context: http://old.nabble.com/Boost-sprint%3A--3407-boost%3A%3Acall_once-not-re-entrant-%28at-least-in-win32%29-tp26466389p26466389.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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