chiark / gitweb /
Use two timers and sigwait rather than looking for EINTR.
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 23 Nov 2018 18:45:52 +0000 (18:45 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 8 Dec 2018 22:30:09 +0000 (22:30 +0000)
commit973a794918444a2c64a1447e8222dc74abee87d1
treeff97625f41108304b65526053e97f6bdf130a73a
parent568bbbe5f3160923617d3b1f4bf2fdd36f9a0857
Use two timers and sigwait rather than looking for EINTR.

The latter had a race condition whereby if the signal from the
fallback timer was delivered before the call to clock_nanosleep(), it
would be lost.  This was a fundamental problem with using asynchronous
signals, and switching to sigwait(), which can wait for blocked signals,
should solve it.
clunk.c