Boost logo

Boost :

From: Pete Becker (petebecker_at_[hidden])
Date: 2002-08-06 08:37:19


At 04:21 PM 8/6/2002 +0300, Peter Dimov wrote:
>We have dynamic initialization of static mutex objects, but we do not have
>static initialization of mutex objects. Hello initialization order.

As I said, "Code that needs this initialization should first call
init_once, which calls do_init the first time it's called." I really don't
want to get sidetracked by implementation details at the moment, so I'll
just say that it's not necessary to use a mutex object internally; it can
be done with static initialization if that's appropriate. The point, at the
moment, is to understand the requirements.

Of course, multi-threaded code that runs threads from constructors is
inherently evil, so this really shouldn't be much of an issue in practice.

        -- Pete

Dinkumware, Ltd.
"Genuine Software"


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