gpt4 book ai didi

pthreads - 如何知道 pthread 是否死亡

转载 作者:行者123 更新时间:2023-12-02 10:40:51 26 4
gpt4 key购买 nike

如何知道 pthread 是否死亡?

有办法检查 pthread 状态吗?

最佳答案

if(pthread_kill(the_thread, 0) == 0)
{
/* still running */
}

参见:pthread_kill

Note: there is an inherent risk to using pthread_kill() to test if a thread is still running. See this post for an explanation: How do I determine if a pthread is alive?

关于pthreads - 如何知道 pthread 是否死亡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5764045/

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