<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 9, 2010, at 9:51 AM, Owen Anderson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 8, 2010, at 10:07 PM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Nov 8, 2010, at 4:36 PM, Owen Anderson wrote:<br><br><blockquote type="cite">Author: resistor<br></blockquote><blockquote type="cite">Date: Mon Nov  8 18:36:06 2010<br></blockquote><blockquote type="cite">New Revision: 118463<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=118463&view=rev">http://llvm.org/viewvc/llvm-project?rev=118463&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Fix PR8441, a thread unsafe static variable in our dynamic library loading facilities.<br></blockquote><br>Hi Owen,<br><br>Does SmartMutex<true> cause a static constructor?<br></div></blockquote><div><br></div><div>Yes, as does sys::Mutex.  Unfortunately, we can't use ManagedStatic here because it would introduce a circular dependency (System --> Support --> System).  I feel like we tried to move ManagedStatic to System at some point in the past, and that it didn't work out, but I don't remember why.</div></div></div></blockquote><br></div><div>Why not just depend on threadsafe statics to handle this?  Targets that don't support threadsafe statics aren't going to support threads anyway.</div><div><br></div><div>-Chris</div><br></body></html>