Subject: Re: [boost] [locale] review part 2.2: source
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-04-18 08:42:22


Artyom wrote:

> Mutex acquisition and release is full memory barrier.

No, they are only guaranteed to have acquire and release semantics,
respectively. Double-checked locking is broken even if they're full barriers
though. That said, MSVC from some version onwards, I forget which,
guarantees that volatile reads have acquire semantics and that volatile
writes have release semantics, and under this assumption, the code is
correct.