summaryrefslogtreecommitdiff
path: root/components/pthreads
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2011-03-21 07:39:24 +0000
committerbernard.xiong <[email protected]>2011-03-21 07:39:24 +0000
commite9148ab6c71daedd18cc240e254065be5688a0a5 (patch)
treef9c9b73fbd1f7908e06ccd732011c7a18d755f96 /components/pthreads
parentadc63f2c0a3b67327d99759f7275b022d2aed3c8 (diff)
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
Diffstat (limited to 'components/pthreads')
-rw-r--r--components/pthreads/pthread.c3
-rw-r--r--components/pthreads/pthread.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/components/pthreads/pthread.c b/components/pthreads/pthread.c
index c779efed18..59a689a51e 100644
--- a/components/pthreads/pthread.c
+++ b/components/pthreads/pthread.c
@@ -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;
diff --git a/components/pthreads/pthread.h b/components/pthreads/pthread.h
index 58a1bb7423..67d8f62c9f 100644
--- a/components/pthreads/pthread.h
+++ b/components/pthreads/pthread.h
@@ -129,7 +129,7 @@ typedef struct pthread_barrier pthread_barrier_t;
int pthread_attr_destroy(pthread_attr_t *attr);
int pthread_attr_init(pthread_attr_t *attr);
-int pthread_init (void);
+int pthread_system_init(void);
int pthread_create (pthread_t *tid, const pthread_attr_t *attr,
void *(*start) (void *), void *arg);