Boost logo

Boost :

Subject: Re: [boost] [thread] static thread_specific_ptr?
From: Joã‹o Abecasis (jpabecasis_at_[hidden])
Date: 2009-03-01 06:19:09

Roland Schwarz wrote:
> Does this mean you have solved the initialization problem for
> local statics? i.e. you made this thread-safe for every compiler?
> (I remeber a very nasty bug in spirit because of the cited pattern.)

This was fixed in Spirit by solving the said problem. You can find the
solution here:


with usage illustrated here, around line 238 (look for


Admittedly it can be cumbersome, but it works.

A performance hit has been reported for repeatedly callling call_once,
that can be solved with double-checked locking. This is not implemented
in the repository version.



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