开发者

Interrupt sleep() function

开发者 https://www.devze.com 2023-01-05 14:08 出处:网络
How can开发者_如何学C I interrupt sleep() using a signal handler?From sleep() function man page:

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

精彩评论

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