aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-10 15:17:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-11 17:55:21 +0000
commit863ae1143f9336f300c300c4d62165c3eac22834 (patch)
treeecef17858965649fa24cd9ed0b36896ba7d46c01 /scripts
parentMerge branch 'xassert-false' (diff)
fdm: add support for managing signals
Add fdm_signal_add() and fdm_signal_del(). Signals added to the fdm will be monitored, and the provided callback called as “soon as possible” from the main context (i.e not from the signal handler context). Monitored signals are *blocked* by default. We use epoll_pwait() to unblock them while we’re polling. This allows us to do race-free signal detection. We use a single handler for all monitored signals; the handler simply updates the signal’s slot in a global array (sized to fit SIGRTMAX signals). When epoll_pwait() returns EINTR, we loop the global array. The callback associated with each signal that fired is called.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions