mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 17:18:24 +00:00
fix joinable semaphore of pthread not clear to NULL when detach.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1337 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -180,10 +180,11 @@ int pthread_detach(pthread_t thread)
|
||||
rt_enter_critical();
|
||||
/* change to detach state */
|
||||
ptd->attr.detachstate = PTHREAD_CREATE_DETACHED;
|
||||
rt_exit_critical();
|
||||
|
||||
/* detach joinable semaphore */
|
||||
rt_sem_delete(ptd->joinable_sem);
|
||||
ptd->joinable_sem = RT_NULL;
|
||||
rt_exit_critical();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user