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:
parent
e14188b4a1
commit
1f1e6f30a3
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user