[llvm-commits] [PATCH] Thread-safe ManagedStatic

Owen Anderson resistor at mac.com
Tue May 19 13:18:07 PDT 2009


 
On Tuesday, May 19, 2009, at 09:55AM, "Luke Dalessandro" <luked at cs.rochester.edu> wrote:

>
>If there was just one static lock for the class, could you stick it 
>inside the LazyInit() routine and get the non-trivial constructor to be 
>threadsafe on Windows?
>
>   void LazyInit() const {
>     static sys::Mutex lock(false);
>     etc...
>   }

Unfortunately, we're not implementing Singletons here.  There can well be more than one static instance of the class.

--Owen



More information about the llvm-commits mailing list