c – 中断sleep()函数

前端之家收集整理的这篇文章主要介绍了c – 中断sleep()函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使用信号处理程序中断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.

因此,如果将信号发送到应用程序,则在睡眠调用之后从指令恢复其执行.

猜你在找的C&C++相关文章