diff options
author | paul <paul> | 2004-07-22 19:14:27 +0000 |
---|---|---|
committer | paul <paul> | 2004-07-22 19:14:27 +0000 |
commit | 05c447dd2e3aab0d045889845da0be5c8d974d4b (patch) | |
tree | 062ca42a848dc0377d7a814d8570e77bc59a2eff /lib/sigevent.h | |
parent | 27eebb3e5713559379ac072d5f36e26044465ab0 (diff) | |
download | quagga-05c447dd2e3aab0d045889845da0be5c8d974d4b.tar.bz2 quagga-05c447dd2e3aab0d045889845da0be5c8d974d4b.tar.xz |
2004-07-14 Paul Jakma <paul@dishone.st>
* sigevent.c: (quagga_signal_handler) add a global caught flag, set
the flags to a constant rather increment to be kinder.
(quagga_sigevent_process) new function, to do core of what
quagga_signal_timer did. dont block signals at all as sig->caught
is volatile sig_atomic_t and should be safe to access from signal
and normal contexts. The signal blocking is unneeded paranoia, but
is left intact under an ifdef, should some platform require it.
Check global caught flag before iterating through array.
(quagga_signal_timer) nearly everything moved to
quagga_sigevent_process. Left in under ifdef, in case some
platform could use a regular timer check for signals.
* sigevent.h: quagga_sigevent_process declaration.
* thread.c: (thread_fetch) check for signals at beginning of
scheduler loop, check for signals if select returns EINTR.
Diffstat (limited to 'lib/sigevent.h')
-rw-r--r-- | lib/sigevent.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sigevent.h b/lib/sigevent.h index 6296736a..20012aff 100644 --- a/lib/sigevent.h +++ b/lib/sigevent.h @@ -23,6 +23,7 @@ #ifndef _QUAGGA_SIGNAL_H #define _QUAGGA_SIGNAL_H + #include <thread.h> #define QUAGGA_SIGNAL_TIMER_INTERVAL 2L @@ -46,4 +47,7 @@ struct quagga_signal_t void signal_init (struct thread_master *m, int sigc, struct quagga_signal_t *signals); +/* check whether there are signals to handle, process any found */ +int quagga_sigevent_process (void); + #endif /* _QUAGGA_SIGNAL_H */ |