[MEDIUM] signals: support redistribution of signal zero when stopping

Signal zero is never delivered by the system. However having a signal to
which functions and tasks can subscribe to be notified of a stopping event
is useful. So this patch does two things :
  1) allow signal zero to be delivered from any function of signal handler
  2) make soft_stop() deliver this signal so that tasks can be notified of
     a stopping condition.
This commit is contained in:
Willy Tarreau
2010-08-27 18:26:11 +02:00
parent 24f4efa670
commit d0807c3c60
4 changed files with 31 additions and 8 deletions

View File

@@ -244,7 +244,9 @@ void usage(char *name)
/*********************************************************************/
/*
* upon SIGUSR1, let's have a soft stop.
* upon SIGUSR1, let's have a soft stop. Note that soft_stop() broadcasts
* a signal zero to all subscribers. This means that it's as easy as
* subscribing to signal 0 to get informed about an imminent shutdown.
*/
void sig_soft_stop(struct sig_handler *sh)
{