pthread_create() 返回的tid不正确

来源:互联网 发布:淘宝卖家需要评价 编辑:程序博客网 时间:2024/06/06 08:59

在父线程调用pthread_create(&tid, NULL, threadFunc, arg);返回的tid特殊情况下和实际子线程的ID不同。


在线程中调用pthread_self()得到的线程ID才是最准确的。