pthread_testcancel()--Create Cancellation Point
Syntax #include <pthread.h> void pthread_testcancel(void); Threadsafe: Yes Signal Safe: No |
When cancelability is disabled, all cancels are held pending in the target thread until the thread changes the cancelability. When cancelability is deferred, all cancels are held pending in the target thread until the thread changes the cancelability, calls a function that is a cancellation point, or calls pthread_testcancel(), thus creating a cancellation point. When cancelability is asynchronous, all cancels are acted upon immediately, interrupting the thread with its processing.
You should not use asynchronous thread cancellation via the PTHREAD_CANCEL_ASYNCHRONOUS option of pthread_setcanceltype(). See the common user errors section of this document for more information.
本文介绍pthread_testcancel函数的使用方法及取消线程的不同状态。在禁用取消能力时,此函数无效;当设置为延迟取消时,所有取消操作将在调用此函数时生效;若为异步取消,则会立即中断线程。
371

被折叠的 条评论
为什么被折叠?



