thisによると、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);