diff --git a/widget/android/nsScreenManagerAndroid.cpp b/widget/android/nsScreenManagerAndroid.cpp index 44c439199897..1057d9fa53f1 100644 --- a/widget/android/nsScreenManagerAndroid.cpp +++ b/widget/android/nsScreenManagerAndroid.cpp @@ -3,6 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#define MOZ_FATAL_ASSERTIONS_FOR_THREAD_SAFETY + #include "nsScreenManagerAndroid.h" #include "nsWindow.h" #include "AndroidBridge.h" diff --git a/widget/xpwidgets/nsBaseScreen.cpp b/widget/xpwidgets/nsBaseScreen.cpp index a62e07c49d6f..352ef2ecd7cd 100644 --- a/widget/xpwidgets/nsBaseScreen.cpp +++ b/widget/xpwidgets/nsBaseScreen.cpp @@ -5,6 +5,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#define MOZ_FATAL_ASSERTIONS_FOR_THREAD_SAFETY + #include "nsBaseScreen.h" NS_IMPL_ISUPPORTS1(nsBaseScreen, nsIScreen) diff --git a/xpcom/glue/nsDebug.h b/xpcom/glue/nsDebug.h index 3ad1a949d1aa..9f8b06bf0681 100644 --- a/xpcom/glue/nsDebug.h +++ b/xpcom/glue/nsDebug.h @@ -315,10 +315,13 @@ /*****************************************************************************/ #ifdef XPCOM_GLUE -#define NS_CheckThreadSafe(owningThread, msg) + #define NS_CheckThreadSafe(owningThread, msg) +#elif defined MOZ_FATAL_ASSERTIONS_FOR_THREAD_SAFETY + #define NS_CheckThreadSafe(owningThread, msg) \ + NS_ABORT_IF_FALSE(owningThread == PR_GetCurrentThread(), msg) #else -#define NS_CheckThreadSafe(owningThread, msg) \ - NS_ASSERTION(owningThread == PR_GetCurrentThread(), msg) + #define NS_CheckThreadSafe(owningThread, msg) \ + NS_ASSERTION(owningThread == PR_GetCurrentThread(), msg) #endif /* When compiling the XPCOM Glue on Windows, we pretend that it's going to