<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes. Thanks for catching that. I’ve added the #ifdefs in r218401.<div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 23, 2014, at 11:29 PM, Craig Topper <<a href="mailto:craig.topper@gmail.com" class="">craig.topper@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Shouldn't the ManagedStatic be inside <span style="font-family:arial,sans-serif;font-size:13px" class="">#ifdef HAVE_TERMINFO?</span></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Sep 22, 2014 at 3:39 PM, Chris Bieneman <span dir="ltr" class=""><<a href="mailto:beanz@apple.com" target="_blank" class="">beanz@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: cbieneman<br class="">
Date: Mon Sep 22 17:39:20 2014<br class="">
New Revision: 218283<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218283&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=218283&view=rev</a><br class="">
Log:<br class="">
Converting terminalHasColors mutex to a global ManagedStatic to avoid the static destructor.<br class="">
<br class="">
Modified:<br class="">
llvm/trunk/lib/Support/Unix/Process.inc<br class="">
<br class="">
Modified: llvm/trunk/lib/Support/Unix/Process.inc<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=218283&r1=218282&r2=218283&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=218283&r1=218282&r2=218283&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Support/Unix/Process.inc (original)<br class="">
+++ llvm/trunk/lib/Support/Unix/Process.inc Mon Sep 22 17:39:20 2014<br class="">
@@ -14,6 +14,7 @@<br class="">
#include "Unix.h"<br class="">
#include "llvm/ADT/Hashing.h"<br class="">
#include "llvm/ADT/StringRef.h"<br class="">
+#include "llvm/Support/ManagedStatic.h"<br class="">
#include "llvm/Support/Mutex.h"<br class="">
#include "llvm/Support/MutexGuard.h"<br class="">
#include "llvm/Support/TimeValue.h"<br class="">
@@ -263,11 +264,12 @@ extern "C" int del_curterm(struct term *<br class="">
extern "C" int tigetnum(char *capname);<br class="">
#endif<br class="">
<br class="">
+static ManagedStatic<sys::Mutex> TermColorMutex;<br class="">
+<br class="">
static bool terminalHasColors(int fd) {<br class="">
#ifdef HAVE_TERMINFO<br class="">
// First, acquire a global lock because these C routines are thread hostile.<br class="">
- static sys::Mutex M;<br class="">
- MutexGuard G(M);<br class="">
+ MutexGuard G(*TermColorMutex);<br class="">
<br class="">
int errret = 0;<br class="">
if (setupterm((char *)nullptr, fd, &errret) != 0)<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class="">~Craig
</div>
</div></blockquote></div><br class=""></div></body></html>