Avoid long sleep in ProfileSaver
This was due to subtracting a >20s number of nanos from the constant for 20s.
Bug: 28880120
(cherry picked from commit 8f15335d96eef7a3bcdd4f2b309a727791b67e68)
Change-Id: Ied5f2a4264e4e0035e1ce8719eda9c57c8482443
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);