Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2006-10-06 11:07:22


Roland Schwarz <roland.schwarz_at_[hidden]> writes:

> Anthony Williams wrote:
>> Sorry, I didn't make it clear. It is the automatic storage duration
>> restriction which is not present on Windows.
>
> I see.
>
> But what is your intent?

I was just pointing out that the implementation of call_once for pthreads as a
simple wrapper around pthread_once_t has a not-documented-by-boost restriction
on usage which is not present for the Windows implementation.

> Are you trying to come up with a single mutex, that is both
> statically (lazy) intializeable (i.e. of type POD) _and_ at the same
> time default constructible?

It would be nice.

> This simply is not feasible.

Currently, I tend to agree.

> If your intent is to work around the pthread_once this is as
> I see it, much easier. Just use a static mutex and condition
> to emulate call_once.
>
> Aren't the ability to statically initialize a mutex, and availability of
> call_once just two sides of the same medal?

Sort of. You can use the same mechanisms for doing both.

Anthony

-- 
Anthony Williams
Software Developer
Just Software Solutions Ltd
http://www.justsoftwaresolutions.co.uk

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