소스 검색

[pthreads] Fix the object check issue.

Bernard Xiong 7 년 전
부모
커밋
f68bb0ec90
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      components/libc/pthreads/pthread_cond.c
  2. 1 0
      components/libc/pthreads/pthread_mutex.c

+ 1 - 0
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;
 }

+ 1 - 0
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;
 }