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 409317 0b814165b471a980ad792d2495f9589f5aab6c84
parent 409316 ad742747a8d096ec7dad94bafb81567f40c6e80d
child 409318 4a50cfa3de8009f8e6900ce44a53afa45e28428e
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [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)) {