Avoid long sleep in ProfileSaver
This was due to subtracting a >20s number of nanos from the constant for 20s.
Bug: 28880120
Change-Id: Ia30b80661f869843484cbac029008530128bd300
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index c5d3ccd..9f6cfb7 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -130,7 +130,7 @@
// We might have been woken up by a huge number of notifications to guarantee saving.
// If we didn't meet the minimum saving period go back to sleep (only if missed by
// a reasonable margin).
- while (kMinSavePeriodNs - sleep_time > (kMinSavePeriodNs / 10)) {
+ while (kMinSavePeriodNs * 0.9 > sleep_time) {
{
MutexLock mu(self, wait_lock_);
period_condition_.TimedWait(self, NsToMs(kMinSavePeriodNs - sleep_time), 0);