signal icon indicating copy to clipboard operation
signal copied to clipboard

`.wait()` for MacOS?

Open dpc opened this issue 7 years ago • 3 comments

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?

dpc avatar Jan 12 '19 00:01 dpc

I'm not sure that sigtimedwait exists on OS X. Contributions are welcome!

tailhook avatar Jan 12 '19 19:01 tailhook

http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html maybe could be used instead?

dpc avatar Jan 12 '19 21:01 dpc

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.

tailhook avatar Jan 13 '19 08:01 tailhook