开发者

Interrupt sleep() function

How can开发者_如何学C I interrupt sleep() using a signal handler?


From sleep() function man page:

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.

So, if a signal is send to the application, its execution is resumed from the instruction after the sleep call.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜