Bug 526586 - XULRunner crashes on startup on Windows r=bustage fix and at least agreement on the approach from dbaron
This commit is contained in:
@@ -44,7 +44,10 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsAutoLock.h"
|
||||
|
||||
#ifdef NS_TLS
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
DWORD gTLSIsMainThreadIndex = TlsAlloc();
|
||||
#elif defined(NS_TLS)
|
||||
NS_TLS bool gTLSIsMainThread = false;
|
||||
#endif
|
||||
|
||||
@@ -106,7 +109,9 @@ nsThreadManager::Init()
|
||||
// GetIsMainThread calls that occur post-Shutdown.
|
||||
mMainThread->GetPRThread(&mMainPRThread);
|
||||
|
||||
#ifdef NS_TLS
|
||||
#ifdef XP_WIN
|
||||
TlsSetValue(gTLSIsMainThreadIndex, (void*) 1);
|
||||
#elif defined(NS_TLS)
|
||||
gTLSIsMainThread = true;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user