www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Threadsafe singleton using volatile,synchonized

 
 CriticalSectionBegin()
 {
 // Your Single thread code goes here
 }
 CriticalSectionEnd()

synchronized {} does exactly that IMHO.
May 30 2007