Merge pull request #1692 from RT-Thread/fix_pthreads

[pthreads] Fix the object check issue.
This commit is contained in:
Bernard Xiong 2018-08-03 19:56:42 +08:00 committed by GitHub
commit a0683e0d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}