Bug 757969 - use __thread in ThreadLocal; r=froydnj

This commit is contained in:
Tom Tromey
2015-11-23 12:11:22 -07:00
parent b3e95be975
commit 2177f7ad7f
22 changed files with 124 additions and 77 deletions

View File

@@ -18,7 +18,7 @@
using namespace mozilla;
static mozilla::ThreadLocal<bool> sTLSIsMainThread;
static MOZ_THREAD_LOCAL(bool) sTLSIsMainThread;
bool
NS_IsMainThread()
@@ -29,12 +29,10 @@ NS_IsMainThread()
void
NS_SetMainThread()
{
if (!sTLSIsMainThread.initialized()) {
if (!sTLSIsMainThread.init()) {
MOZ_CRASH();
}
sTLSIsMainThread.set(true);
if (!sTLSIsMainThread.init()) {
MOZ_CRASH();
}
sTLSIsMainThread.set(true);
MOZ_ASSERT(NS_IsMainThread());
}