As noticed by @hartwork, pselect is not a reliable way of catching signals on Linux: in case of high input pressure, signal delivery is starved. Pull request #132 partially fixed the issue by issuing two consecutive pselect calls, but this left a race window between these two calls.
This pull request fixes the issue without race conditions by using plain select() and a self-pipe, which makes signal delivery reliable.
This is one of two possible alternatives, the other one being signalfd (#142).
As noticed by @hartwork,
pselect
is not a reliable way of catching signals on Linux: in case of high input pressure, signal delivery is starved. Pull request #132 partially fixed the issue by issuing two consecutivepselect
calls, but this left a race window between these two calls.This pull request fixes the issue without race conditions by using plain select() and a self-pipe, which makes signal delivery reliable.
This is one of two possible alternatives, the other one being
signalfd
(#142).