Make NS_IsMainThread faster on our major platforms. (Bug 521750) r=dbaron
This commit is contained in:
@@ -38,11 +38,16 @@
|
||||
|
||||
#include "nsThreadManager.h"
|
||||
#include "nsThread.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIClassInfoImpl.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsAutoLock.h"
|
||||
|
||||
#ifdef NS_TLS
|
||||
NS_TLS bool gTLSIsMainThread = false;
|
||||
#endif
|
||||
|
||||
typedef nsTArray< nsRefPtr<nsThread> > nsThreadArray;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -101,6 +106,10 @@ nsThreadManager::Init()
|
||||
// GetIsMainThread calls that occur post-Shutdown.
|
||||
mMainThread->GetPRThread(&mMainPRThread);
|
||||
|
||||
#ifdef NS_TLS
|
||||
gTLSIsMainThread = true;
|
||||
#endif
|
||||
|
||||
mInitialized = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user