Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3407: boost::call_once not re-entrant (at least in win32)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-06 14:58:26
#3407: boost::call_once not re-entrant (at least in win32)
-----------------------------------------------+----------------------------
Reporter: Vincent Falco <thevinn@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: threads
Version: Boost 1.40.0 | Severity: Problem
Keywords: threads |
-----------------------------------------------+----------------------------
Comment(by steven_watanabe):
The flag must be set after the function is called. The reason is that if
another thread calls call_once, it should block until the function is
completed. 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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3407#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC