Also rename: processQueues to process_queues.
// start service, mark as required
if (do_pin) service->pinStart();
service->start();
- services->processQueues(true);
+ services->process_queues();
already_there = service->getState() == service_state_t::STARTED;
break;
case DINIT_CP_STOPSERVICE:
if (do_pin) service->pinStop();
service->stop(true);
service->forceStop();
- services->processQueues(false);
+ services->process_queues();
already_there = service->getState() == service_state_t::STOPPED;
break;
case DINIT_CP_WAKESERVICE:
// re-start a stopped service (do not mark as required)
if (do_pin) service->pinStart();
service->start(false);
- services->processQueues(true);
+ services->process_queues();
already_there = service->getState() == service_state_t::STARTED;
break;
case DINIT_CP_RELEASESERVICE:
// remove required mark, stop if not required by dependents
if (do_pin) service->pinStop();
service->stop(false);
- services->processQueues(false);
+ services->process_queues();
already_there = service->getState() == service_state_t::STOPPED;
break;
}
}
else {
service->unpin();
- services->processQueues(true);
+ services->process_queues();
char ack_buf[] = { (char) DINIT_RP_ACK };
if (! queuePacket(ack_buf, 1)) return false;
}
service_record *record = find_service(name);
if (record != nullptr) {
record->stop();
- processQueues(false);
+ process_queues();
}
}
// service process.
if (! restart_ps_process()) {
emergency_stop();
- services->processQueues(false);
+ services->process_queues();
}
return;
}
else {
emergency_stop();
}
- services->processQueues(false);
+ services->process_queues();
}
void bgproc_service::handle_exit_status(int exit_status) noexcept
if (need_stop) {
// Failed startup: no auto-restart.
emergency_stop();
- services->processQueues(false);
+ services->process_queues();
}
return;
doing_recovery = true;
if (! restart_ps_process()) {
emergency_stop();
- services->processQueues();
+ services->process_queues();
}
return;
}
stopDependents();
stopped();
}
- services->processQueues(false);
+ services->process_queues();
}
void scripted_service::handle_exit_status(int exit_status) noexcept
// can be stopped:
stopped();
}
- services->processQueues(false);
+ services->process_queues();
}
else { // STARTING
if (exit_status == 0) {
}
failed_to_start();
}
- services->processQueues(true);
+ services->process_queues();
}
}
}
}
- sr->services->processQueues(true);
+ sr->services->process_queues();
return rearm::REMOVED;
}
pinned_started = false;
if (desired_state == service_state_t::STOPPED) {
do_stop();
- services->processQueues(false);
+ services->process_queues();
}
}
if (pinned_stopped) {
pinned_stopped = false;
if (desired_state == service_state_t::STARTED) {
do_start();
- services->processQueues(true);
+ services->process_queues();
}
}
}
desired_state = service_state_t::STOPPED;
forceStop();
}
- services->processQueues();
+ services->process_queues();
}
}
void start_service(service_record *svc)
{
svc->start();
- processQueues();
+ process_queues();
}
// Stop the specified service. Its active mark will be cleared.
void stop_service(service_record *svc)
{
svc->stop(true);
- processQueues();
+ process_queues();
}
// Locate an existing service record.
}
// Process state propagation and start/stop queues, until they are empty.
- // TODO remove the pointless parameter
- void processQueues(bool ignoredparam = false) noexcept
+ void process_queues() noexcept
{
while (! stop_queue.is_empty() || ! prop_queue.is_empty()) {
while (! prop_queue.is_empty()) {
(*i)->stop(false);
(*i)->unpin();
}
- processQueues(false);
+ process_queues();
}
void set_auto_restart(bool restart) noexcept