signal
signal copied to clipboard
`.wait()` for MacOS?
It seems right now wait() is implemented only for Linux. Is there a fundamental problem? Any workarounds to make the code work on any platform?
I'm not sure that sigtimedwait exists on OS X. Contributions are welcome!
http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html maybe could be used instead?
Well, sigpending in a loop with sleep might work. Another question is whether to unblock signals as part of wait() function call as this might be racy but would make wakups more precise (which is what you expect from signals) and avoid most spurious wakeups.