On Thursday, 15 March 2018 at 19:23:26 UTC, Dmitry Olshansky
wrote:
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote:
[...]
Another option if you are on linux is to use eventfd. Then you
can trigger it with simple write on eventfd descriptor.
As far as waiting goes it’s either read on descriptor or
poll/select.
f it seems a bit more involved.
[...]
However I’d be super careful about mutexes with signal
handlers. Really self-pipe trick or eventfd seems way more
signal safe.
There's also signalfd which is quite practical to change signals
in select/poll/epoll events.