From f68bb0ec90a6e15aeb6accaf18c5eff1a0dfc90c Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 3 Aug 2018 14:28:45 +0800 Subject: [PATCH] [pthreads] Fix the object check issue. --- components/libc/pthreads/pthread_cond.c | 1 + components/libc/pthreads/pthread_mutex.c | 1 + 2 files changed, 2 insertions(+) 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; }