←back to thread

345 points splitbrain | 1 comments | | HN request time: 0.201s | source
Show context
yazzku ◴[] No.41839476[source]
Can you not use std::condition_variable to avoid the active waiting of the signal?
replies(2): >>41840920 #>>41842565 #
1. listeria ◴[] No.41842565[source]
I don't know if std::condition_variable is async-signal safe, but an easy fix is to replace the sleeping with pause(2). There's also sigwait(3), which wouldn't need a signal handler.