Bug 754572 - add option to use fatal assertions in NS_CheckThreadSafe, use it in nsBaseScreen and nsScreenManagerAndroid - r=bsmedberg

This commit is contained in:
Benoit Jacob 2012-07-05 10:32:10 -04:00
Родитель 72a25f630d
Коммит e3783dda32
3 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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