Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
pthread_cond_destroy问题 #3870
pthread_cond_destroy问题 #3870
Comments
|
多谢反馈,后面修正下 |
|
@zmj64351508 rt_sem_trytake在计数为0,并且time为0条件下,返回应该就是-RT_ETIMEOUT,然后pthread_cond_destroy去判断这个返回值时候,就应该是EBUSY状态的。因为它没成功获取到信号量,所以也不能clean condition。 |
|
楼主确认下问题吧,如果没问题,这个issue就关闭吧 |
int ret;
pthread_cond_t hdl;
pthread_cond_init(&hdl, NULL);
ret = pthread_cond_destroy(&hdl);
问题:运行以上代码ret最终是EBUSY。看了下代码,rt_sem_trytake在计数为0的情况下会返回-RT_ETIMEOUT,pthread_cond_destroy会判断rt_sem_trytake的返回值,一旦不是RT_OK就返回EBUSY。
希望的结果:上述代码运行后ret应该是0。