
23 Mar
2007
23 Mar
'07
9:20 a.m.
Anthony Williams <anthony_w.geo@yahoo.com> 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