mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
Fix recursive mutex bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@770 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -92,7 +92,7 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
|
||||
if (attr && pthread_mutexattr_verifytype(type) == OK)
|
||||
{
|
||||
attr->type = type;
|
||||
return 0;
|
||||
return OK;
|
||||
}
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,14 @@ int pthread_mutexattr_verifytype(int type)
|
||||
{
|
||||
/* The depends on the value assigments in pthread.h */
|
||||
|
||||
return (type >= PTHREAD_MUTEX_NORMAL && type <= PTHREAD_MUTEX_RECURSIVE);
|
||||
if (type >= PTHREAD_MUTEX_NORMAL && type <= PTHREAD_MUTEX_RECURSIVE)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MUTEX_TYPES */
|
||||
|
||||
Reference in New Issue
Block a user