diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-06-05 01:57:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-06-05 01:57:49 +0000 |
commit | 1537061e4e8d2d77fd03e0efe6338c29756b4901 (patch) | |
tree | c58e08501a2309185f6e6ae87ad7157f99eb10a2 /nuttx | |
parent | ef5e7d866967762dd8c41874b03fc7ceab3c7060 (diff) | |
download | nuttx-1537061e4e8d2d77fd03e0efe6338c29756b4901.tar.gz nuttx-1537061e4e8d2d77fd03e0efe6338c29756b4901.tar.bz2 nuttx-1537061e4e8d2d77fd03e0efe6338c29756b4901.zip |
Fix recursive mutex bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@770 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/sched/pthread_mutexattrsettype.c | 2 | ||||
-rw-r--r-- | nuttx/sched/pthread_mutexattrverifytype.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/nuttx/sched/pthread_mutexattrsettype.c b/nuttx/sched/pthread_mutexattrsettype.c index c50316c3c..150fc7c4f 100644 --- a/nuttx/sched/pthread_mutexattrsettype.c +++ b/nuttx/sched/pthread_mutexattrsettype.c @@ -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; } diff --git a/nuttx/sched/pthread_mutexattrverifytype.c b/nuttx/sched/pthread_mutexattrverifytype.c index e089be088..a172cb826 100644 --- a/nuttx/sched/pthread_mutexattrverifytype.c +++ b/nuttx/sched/pthread_mutexattrverifytype.c @@ -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 */ |