mirror of
https://github.com/textmate/textmate.git
synced 2026-01-12 08:18:21 -05:00
Replace thread_local with boost equivalent
The new version of clang (Apple LLVM version 6.1.0) as shipped with Xcode 6.3, disabled TLS. According to http://clang.llvm.org/cxx_status.html, in order to support `thread_local`, the C++ runtime library from g++-4.8 or later is needed. For now, we can use the boost `thread_specific_ptr`. This is probably a reasonable solution since 1) it should be portable with old and future versions of (Apple's) clang and 2) requires no additional dependencies.
This commit is contained in:
committed by
Allan Odgaard
parent
23509380cb
commit
172ce9d428
@@ -1,4 +1,5 @@
|
||||
#include "info.h"
|
||||
#include <boost/thread/tss.hpp>
|
||||
#include <oak/debug.h>
|
||||
|
||||
/* CrashReporter info */
|
||||
@@ -58,8 +59,11 @@ namespace
|
||||
|
||||
static stack_t& stack ()
|
||||
{
|
||||
thread_local stack_t stack;
|
||||
return stack;
|
||||
static boost::thread_specific_ptr<stack_t> stackPtr;
|
||||
if(!stackPtr.get())
|
||||
stackPtr.reset(new stack_t);
|
||||
|
||||
return *stackPtr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user