gpt4 book ai didi

c++ - 中断 sleep() 函数

转载 作者:可可西里 更新时间:2023-11-01 18:37:21 24 4
gpt4 key购买 nike

如何使用信号处理程序中断 sleep()?

最佳答案

来自 sleep() 函数手册页:

The sleep() function suspends execution of the calling thread until either seconds seconds have elapsed or a signal is delivered to the thread and its action is to invoke a signal-catching function or to terminate the thread or process. System activity may lengthen the sleep by an indeterminate amount.

因此,如果向应用程序发送了一个信号,它的执行将从 sleep 调用后的指令恢复。

关于c++ - 中断 sleep() 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3157295/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com