gpt4 book ai didi

pthread_cancel() 可以阻塞吗?

转载 作者:太空宇宙 更新时间:2023-11-03 23:46:44 26 4
gpt4 key购买 nike

c 函数 pthread_cancel() 可以阻塞还是总是立即返回?我的手册页指出:

The above steps happen asynchronously with respect to the pthread_cancel() call; the return status of pthread_cancel() merely informs the caller whether the cancellation request was successfully queued.

这当然表明不是。有没有什么情况会阻塞调用?

提前致谢。

最佳答案

不,对 pthread_cancel() 的调用不会阻塞。它仅注册一个取消请求。

它可能阻塞的唯一情况是线程试图取消自身,但在函数实现中已处理:check this link

关于pthread_cancel() 可以阻塞吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30806985/

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