Bug 951431 - Monitor main thread hangs using BackgroundHangMonitor; r=vladan

This commit is contained in:
Jim Chen
2014-01-14 10:33:31 -06:00
parent 018fa62b78
commit e04ed47a12
2 changed files with 25 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/HangMonitor.h"
#include "mozilla/BackgroundHangMonitor.h"
#include "mozilla/Monitor.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
@@ -344,6 +345,10 @@ NotifyActivity(ActivityType activityType)
}
cumulativeUILagMS = 0;
}
if (gThread && !gShutdown) {
mozilla::BackgroundHangMonitor().NotifyActivity();
}
}
void
@@ -354,6 +359,10 @@ Suspend()
// Because gTimestamp changes this resets the wait count.
gTimestamp = PR_INTERVAL_NO_WAIT;
if (gThread && !gShutdown) {
mozilla::BackgroundHangMonitor().NotifyWait();
}
}
} } // namespace mozilla::HangMonitor