
27 Jan
2010
27 Jan
'10
10:08 p.m.
AMDG Andrew Chinkoff wrote:
*** BEGIN EXPLANATION *** Let us imagine that boost::call_once has approximately this implementation (in pseudo code):
call_once(function foo) { if(!called) { Locker locker; if(!called) { called = true; foo(); (1) } } }
called = true; has to go /after/ the call to foo. Otherwise, this works once you add in the magic needed to prevent the compiler and the hardware from reordering operations. In Christ, Steven Watanabe