Bug 923486, part 1 - Harmonize ordering of definitions of NS_IsMainThread(). r=ehsan

This commit is contained in:
Andrew McCreight 2013-10-17 06:24:30 -07:00
parent e07a2064e0
commit 4b43048358

View File

@ -114,7 +114,24 @@ NS_GetMainThread(nsIThread **result)
#endif
}
#ifndef MOZILLA_INTERNAL_API
#if defined(MOZILLA_INTERNAL_API) && defined(XP_WIN)
extern DWORD gTLSThreadIDIndex;
bool
NS_IsMainThread()
{
return TlsGetValue(gTLSThreadIDIndex) == (void*) mozilla::threads::Main;
}
#elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
// NS_IsMainThread() is defined inline in MainThreadUtils.h
#else
#ifdef MOZILLA_INTERNAL_API
bool NS_IsMainThread()
{
bool result = false;
nsThreadManager::get()->nsThreadManager::GetIsMainThread(&result);
return bool(result);
}
#else
bool NS_IsMainThread()
{
bool result = false;
@ -124,20 +141,7 @@ bool NS_IsMainThread()
mgr->GetIsMainThread(&result);
return bool(result);
}
#elif defined(XP_WIN)
extern DWORD gTLSThreadIDIndex;
bool
NS_IsMainThread()
{
return TlsGetValue(gTLSThreadIDIndex) == (void*) mozilla::threads::Main;
}
#elif !defined(NS_TLS)
bool NS_IsMainThread()
{
bool result = false;
nsThreadManager::get()->nsThreadManager::GetIsMainThread(&result);
return bool(result);
}
#endif
#endif
NS_METHOD