Merge "init: handle process actions when waiting for exec services" am: db8881b769 am: e503a21b0e
Change-Id: I90b873642bc6008d15901e4d5b561a111173c435
This commit is contained in:
commit
6abf55072f
1 changed files with 9 additions and 9 deletions
|
|
@ -780,18 +780,18 @@ int SecondStageMain(int argc, char** argv) {
|
||||||
if (!(waiting_for_prop || Service::is_exec_service_running())) {
|
if (!(waiting_for_prop || Service::is_exec_service_running())) {
|
||||||
am.ExecuteOneCommand();
|
am.ExecuteOneCommand();
|
||||||
}
|
}
|
||||||
if (!(waiting_for_prop || Service::is_exec_service_running())) {
|
if (!IsShuttingDown()) {
|
||||||
if (!IsShuttingDown()) {
|
auto next_process_action_time = HandleProcessActions();
|
||||||
auto next_process_action_time = HandleProcessActions();
|
|
||||||
|
|
||||||
// If there's a process that needs restarting, wake up in time for that.
|
// If there's a process that needs restarting, wake up in time for that.
|
||||||
if (next_process_action_time) {
|
if (next_process_action_time) {
|
||||||
epoll_timeout = std::chrono::ceil<std::chrono::milliseconds>(
|
epoll_timeout = std::chrono::ceil<std::chrono::milliseconds>(
|
||||||
*next_process_action_time - boot_clock::now());
|
*next_process_action_time - boot_clock::now());
|
||||||
if (*epoll_timeout < 0ms) epoll_timeout = 0ms;
|
if (*epoll_timeout < 0ms) epoll_timeout = 0ms;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(waiting_for_prop || Service::is_exec_service_running())) {
|
||||||
// If there's more work to do, wake up again immediately.
|
// If there's more work to do, wake up again immediately.
|
||||||
if (am.HasMoreCommands()) epoll_timeout = 0ms;
|
if (am.HasMoreCommands()) epoll_timeout = 0ms;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue