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:
Benjamin Smedberg
2009-11-09 14:30:01 -05:00
parent 9c2f4c78df
commit aeab3a15f2
5 changed files with 25 additions and 7 deletions

View File

@@ -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