diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-04 16:30:04 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-06-18 12:22:44 +0000 |
commit | ac49bda4d493eef2de1a8c957bd54ce65855f534 (patch) | |
tree | 625a7d81bd000bdf3c30c2a1e0a2f71da6f3744e /include/osmocom/core/select.h | |
parent | 8158882b546518425535b7c6ee572e1fb2173846 (diff) |
osmo_select_shutdown_request(): allow finishing pending writes on SIGTERM
Allow telling osmo_select_main* to only service pending writes (shutdown
mode). Introduce API fuctions to indicate a shutdown request, and find
out whether shutdown is complete.
Some osmo programs have a curious sleep of few seconds upon receiving
SIGTERM. The idea presumably was to finish off pending writes before
halting the program. But a sleep() on program exit is annoying,
especially when there usually are no pending writes, and when osmo-bsc
is launched numerous times for tests.
Change-Id: Ib94d4316924103459577087c2214188679db2227
Diffstat (limited to 'include/osmocom/core/select.h')
-rw-r--r-- | include/osmocom/core/select.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index b4101998..e9f19a56 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -105,5 +105,8 @@ struct osmo_signalfd { struct osmo_signalfd * osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data); +void osmo_select_shutdown_request(); +int osmo_select_shutdown_requested(); +bool osmo_select_shutdown_done(); /*! @} */ |