/* * This function temporarily disables listening so that another new instance * can start listening. It is designed to be called upon reception of a * SIGTTOU, after which either a SIGUSR1 can be sent to completely stop * the proxy, or a SIGTTIN can be sent to listen again. */ void pause_proxies(void) { int err; struct proxy *p; struct peers *prs; err = 0; p = proxy; tv_update_date(0,1); /* else, the old time before select will be used */ while (p) { err |= !pause_proxy(p); p = p->next; } prs = peers; while (prs) { p = prs->peers_fe; err |= !pause_proxy(p); prs = prs->next; } if (err) { Warning("Some proxies refused to pause, performing soft stop now.\n"); send_log(p, LOG_WARNING, "Some proxies refused to pause, performing soft stop now.\n"); soft_stop(); } }
/* * This function temporarily disables listening so that another new instance * can start listening. It is designed to be called upon reception of a * SIGTTOU, after which either a SIGUSR1 can be sent to completely stop * the proxy, or a SIGTTIN can be sent to listen again. */ void pause_proxies(void) { int err; struct proxy *p; err = 0; p = proxy; tv_update_date(0,1); /* else, the old time before select will be used */ while (p) { if (p->cap & PR_CAP_FE && p->state != PR_STERROR && p->state != PR_STSTOPPED && p->state != PR_STPAUSED) { Warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id); send_log(p, LOG_WARNING, "Pausing %s %s.\n", proxy_cap_str(p->cap), p->id); pause_proxy(p); if (p->state != PR_STPAUSED) { err |= 1; Warning("%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id); send_log(p, LOG_WARNING, "%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id); } } p = p->next; } if (err) { Warning("Some proxies refused to pause, performing soft stop now.\n"); send_log(p, LOG_WARNING, "Some proxies refused to pause, performing soft stop now.\n"); soft_stop(); } }
jack_raw_output::~jack_raw_output () { soft_stop (); if (_client != 0) jack_client_close (_client); }
oss_raw_output::~oss_raw_output () { soft_stop (); ::close (_handle); }
void executor::stop_and_join() { soft_stop(); for (std::thread &thread : threads_) thread.join(); }