Fix recursive mutex bug
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@770 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
fe1f8511b1
commit
464b3b848d
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue