Boost logo

Boost :

Subject: Re: [boost] Thread-safe singleton pattern
From: Helge Bahmann (hcb_at_[hidden])
Date: 2010-01-26 07:30:14

On Mon, 25 Jan 2010, Alex Miller wrote:

> Your implementation seems to be a fairly standard implementation of double
> checked locking, and thus is likely vulnerable to the issues outlined in C++
> and the Perils of Double-Checked
> Locking<>
> .

yes, the implementation is broken; see e.g.

for a correct one, using Boost.Atomic

Boost list run by bdawes at, gregod at, cpdaniel at, john at