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:
patacongo 2008-06-05 01:57:49 +00:00
parent e14188b4a1
commit 1f1e6f30a3
2 changed files with 9 additions and 2 deletions

View File

@ -92,7 +92,7 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
if (attr && pthread_mutexattr_verifytype(type) == OK) if (attr && pthread_mutexattr_verifytype(type) == OK)
{ {
attr->type = type; attr->type = type;
return 0; return OK;
} }
return EINVAL; return EINVAL;
} }

View File

@ -89,7 +89,14 @@ int pthread_mutexattr_verifytype(int type)
{ {
/* The depends on the value assigments in pthread.h */ /* 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 */ #endif /* CONFIG_MUTEX_TYPES */