Bug 1234618 - BHR doesn't seem to handle the idle case correctly. r=nchen a=ritu
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 25 Dec 2015 18:19:56 -0500
changeset 305938 2e553b97f22fa027fbb136c1db62e0905a88f3d0
parent 305937 a602dbc1a620fa3cd96a093b13893376aed3106a
child 305939 5385e861c1838df21976d3e32d7d7f6c67bfd702
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchen, ritu
bugs1234618
milestone44.0
Bug 1234618 - BHR doesn't seem to handle the idle case correctly. r=nchen a=ritu
xpcom/threads/BackgroundHangMonitor.cpp
--- a/xpcom/threads/BackgroundHangMonitor.cpp
+++ b/xpcom/threads/BackgroundHangMonitor.cpp
@@ -332,19 +332,21 @@ BackgroundHangManager::RunMonitorThread(
       PRIntervalTime nextRecheck;
       if (currentThread->mHanging) {
         nextRecheck = currentThread->mMaxTimeout;
       } else {
         nextRecheck = currentThread->mTimeout;
       }
       recheckTimeout = std::min(recheckTimeout, nextRecheck - hangTime);
 
-      /* We wait for a quarter of the shortest timeout
-         value to give mIntervalNow enough granularity. */
-      waitTime = std::min(waitTime, currentThread->mTimeout / 4);
+      if (currentThread->mTimeout != PR_INTERVAL_NO_TIMEOUT) {
+        /* We wait for a quarter of the shortest timeout
+           value to give mIntervalNow enough granularity. */
+        waitTime = std::min(waitTime, currentThread->mTimeout / 4);
+      }
     }
   }
 
   /* We are shutting down now.
      Wait for all outstanding monitors to unregister. */
   while (!mHangThreads.isEmpty()) {
     autoLock.Wait(PR_INTERVAL_NO_TIMEOUT);
   }