Bug 1368286 - Take the idle queue into account in nsThread::HasPendingEvents(); r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 29 May 2017 14:23:00 -0400
changeset 361200 0b814165b471a980ad792d2495f9589f5aab6c84
parent 361199 ad742747a8d096ec7dad94bafb81567f40c6e80d
child 361201 4a50cfa3de8009f8e6900ce44a53afa45e28428e
push id31918
push usercbook@mozilla.com
push dateTue, 30 May 2017 09:39:11 +0000
treeherdermozilla-central@286f71223256 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1368286
milestone55.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 1368286 - Take the idle queue into account in nsThread::HasPendingEvents(); r=smaug
xpcom/threads/nsThread.cpp
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -1041,17 +1041,18 @@ NS_IMETHODIMP
 nsThread::HasPendingEvents(bool* aResult)
 {
   if (NS_WARN_IF(PR_GetCurrentThread() != mThread)) {
     return NS_ERROR_NOT_SAME_THREAD;
   }
 
   {
     MutexAutoLock lock(mLock);
-    *aResult = mEvents->HasPendingEvent(lock);
+    *aResult = mEvents->HasPendingEvent(lock) ||
+               mIdleEvents.HasPendingEvent(lock);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsThread::RegisterIdlePeriod(already_AddRefed<nsIIdlePeriod> aIdlePeriod)
 {
   if (NS_WARN_IF(PR_GetCurrentThread() != mThread)) {