From 16db4346a2198df13baa9b66ba9e94cfe89ec059 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 30 Nov 2016 15:43:42 -0800 Subject: [PATCH] init: don't wait if we have more work to do Bug: 33212253 Test: On marlin Change-Id: I8502eaa73fac6953d358af01482760b3249cfd67 --- init/init.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/init.cpp b/init/init.cpp index 371186bf3..ef6f37c0e 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -731,15 +731,15 @@ int main(int argc, char** argv) { // By default, sleep until something happens. int epoll_timeout_ms = -1; - // If there's more work to do, wake up again immediately. - if (am.HasMoreCommands()) epoll_timeout_ms = 0; - // If there's a process that needs restarting, wake up in time for that. if (process_needs_restart_at != 0) { epoll_timeout_ms = (process_needs_restart_at - time(nullptr)) * 1000; if (epoll_timeout_ms < 0) epoll_timeout_ms = 0; } + // If there's more work to do, wake up again immediately. + if (am.HasMoreCommands()) epoll_timeout_ms = 0; + bootchart_sample(&epoll_timeout_ms); epoll_event ev;