根据这个链接,pthread_join将输出参数**thread_return设置为pd->result,然后释放pd。这样做是否正确?我是否遗漏了什么,或者glibc中存在严重的错误?
/* We mark the thread as terminated and as joined. */
pd->tid = -1;
/* Store the return value if the caller is interested. */
if (thread_return != NULL)
*thread_return = pd->result;
/* Free the TCB. */
__free_tcb (pd);