天天看點

pthread_create() 傳回的tid不正确

在父線程調用pthread_create(&tid, NULL, threadFunc, arg);傳回的tid特殊情況下和實際子線程的ID不同。

線上程中調用pthread_self()得到的線程ID才是最準确的。

繼續閱讀