天天看点

pthread_create() 返回的tid不正确

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

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

继续阅读