Bug 1040726 - Urgent message assertion in ProcessNextEvent shouldn't fire off the main thread (r=bsmedberg)
authorBill McCloskey <wmccloskey@mozilla.com>
Fri, 18 Jul 2014 09:16:15 -0700
changeset 216861 e1abce6fa2c1c427306ddf87f5d9c57e80530ae7
parent 216860 9f9ac2060b54c84a8fa9e83699d2b11e67a97612
child 216862 d323591130d0dfe8c3d7590d0d65e7bb3361c075
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1040726
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1040726 - Urgent message assertion in ProcessNextEvent shouldn't fire off the main thread (r=bsmedberg)
xpcom/threads/nsThread.cpp
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -682,17 +682,18 @@ void canary_alarm_handler(int signum)
     }                                                                          \
   PR_END_MACRO
 
 NS_IMETHODIMP
 nsThread::ProcessNextEvent(bool aMayWait, bool* aResult)
 {
   LOG(("THRD(%p) ProcessNextEvent [%u %u]\n", this, aMayWait, mRunningEvent));
 
-  MOZ_RELEASE_ASSERT(!ipc::ProcessingUrgentMessages());
+  // If we're on the main thread, we shouldn't be dispatching CPOWs.
+  MOZ_RELEASE_ASSERT(mIsMainThread != MAIN_THREAD || !ipc::ProcessingUrgentMessages());
 
   if (NS_WARN_IF(PR_GetCurrentThread() != mThread)) {
     return NS_ERROR_NOT_SAME_THREAD;
   }
 
   // The toplevel event loop normally blocks waiting for the next event, but
   // if we're trying to shut this thread down, we must exit the event loop when
   // the event queue is empty.