【发布时间】:2013-01-10 22:57:32
【问题描述】:
根据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);
【问题讨论】:
-
请提供一个最小的、可编译的测试用例。
标签: c pthreads glibc memory-management