Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-03-23 05:20:09


Anthony Williams <anthony_w.geo_at_[hidden]> writes:

> Actually I think the store can be
> ordinary too since it's also done under a lock, and the unlock has (or should
> have, anyway) release semantics.

No, you're right --- the store needs to be store_release, since we need to
ensure that the results of f() are visible before the stored flag value has
been stored. The release at mutex unlock is potentially too late.

Anthony

-- 
Anthony Williams
Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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