提交 277325c3 编写于 作者: B bernard

[pthreads] fix pthread_cond_init issue when attr is NULL.

上级 fe2047ba
......@@ -98,7 +98,11 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
rt_snprintf(cond_name, sizeof(cond_name), "cond%02d", cond_num++);
cond->attr = *attr;
if (attr == RT_NULL) /* use default value */
cond->attr = PTHREAD_PROCESS_PRIVATE;
else
cond->attr = *attr;
result = rt_sem_init(&cond->sem, cond_name, 0, RT_IPC_FLAG_FIFO);
if (result != RT_EOK)
return EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册