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

@@ -46,6 +46,10 @@
# include "nsServiceManagerUtils.h"
#endif
#ifdef XP_WIN
#include <windows.h>
#endif
#ifndef XPCOM_GLUE_AVOID_NSPR
NS_IMPL_THREADSAFE_ISUPPORTS1(nsRunnable, nsIRunnable)
@@ -126,6 +130,13 @@ bool NS_IsMainThread()
mgr->GetIsMainThread(&result);
return bool(result);
}
#elif defined(XP_WIN)
extern DWORD gTLSIsMainThreadIndex;
bool
NS_IsMainThread()
{
return !!TlsGetValue(gTLSIsMainThreadIndex);
}
#elif !defined(NS_TLS)
bool NS_IsMainThread()
{