diff options
| author | Bernard Xiong <[email protected]> | 2018-08-03 14:28:45 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-08-03 14:28:45 +0800 |
| commit | f68bb0ec90a6e15aeb6accaf18c5eff1a0dfc90c (patch) | |
| tree | 519f307e9bb4d218bde87260a2fedb5bb43e8d5e /components/libc | |
| parent | 6f012541b06533c5610011d7aefa3844dd3e5c43 (diff) | |
[pthreads] Fix the object check issue.
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/pthreads/pthread_cond.c | 1 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_mutex.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/components/libc/pthreads/pthread_cond.c b/components/libc/pthreads/pthread_cond.c index 9349e84050..1a4217310e 100644 --- a/components/libc/pthreads/pthread_cond.c +++ b/components/libc/pthreads/pthread_cond.c @@ -109,6 +109,7 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) /* detach the object from system object container */ rt_object_detach(&(cond->sem.parent.parent)); + cond->sem.parent.parent.type = RT_Object_Class_Semaphore; return 0; } diff --git a/components/libc/pthreads/pthread_mutex.c b/components/libc/pthreads/pthread_mutex.c index 3a3fbe61e5..c7c3d38c4f 100644 --- a/components/libc/pthreads/pthread_mutex.c +++ b/components/libc/pthreads/pthread_mutex.c @@ -141,6 +141,7 @@ int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) /* detach the object from system object container */ rt_object_detach(&(mutex->lock.parent.parent)); + mutex->lock.parent.parent.type = RT_Object_Class_Mutex; return 0; } |
