开发者

sleep indefinitely

开发者 https://www.devze.com 2023-03-03 01:27 出处:网络
开发者_Python百科I was wondering if there is a statement which I can use to have a program sleep indefinitely (probably using sleep function??). (I am obviously doing this waiting for a signal that is

开发者_Python百科I was wondering if there is a statement which I can use to have a program sleep indefinitely (probably using sleep function??). (I am obviously doing this waiting for a signal that is going to be delivered at some time to this process and it will wake it up)


You want pause().

EDIT: The most likely circumstances under which you might want to use pause() will actually cause a race condition, so prefer sigsuspend().


On Unix, see either pause or sigsuspend.


And on Windows use Sleep(INFINITE)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号