summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-03-25 09:48:10 +0000
committerru <ru@FreeBSD.org>2008-03-25 09:48:10 +0000
commite2f2131976c50e61068074f9b8e58763dfa61d8b (patch)
tree359366239606d6df88bcb60904f9823fade887e6 /lib/libthr/thread/thr_mutex.c
parent3b1bf8c2e9222b7d27e8b9084e637a84005de7ba (diff)
downloadFreeBSD-src-e2f2131976c50e61068074f9b8e58763dfa61d8b.zip
FreeBSD-src-e2f2131976c50e61068074f9b8e58763dfa61d8b.tar.gz
Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().
Reviewed by: davidxu
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index b16cf6e..a3f6c1d 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <sys/queue.h>
#include <pthread.h>
+#include <pthread_np.h>
#include "un-namespace.h"
#include "thr_private.h"
@@ -793,8 +794,9 @@ int
_pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count)
{
if (*mutex == NULL)
- return (0);
- return (*mutex)->m_spinloops;
+ return (EINVAL);
+ *count = (*mutex)->m_spinloops;
+ return (0);
}
int
@@ -831,8 +833,9 @@ int
_pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count)
{
if (*mutex == NULL)
- return (0);
- return (*mutex)->m_yieldloops;
+ return (EINVAL);
+ *count = (*mutex)->m_yieldloops;
+ return (0);
}
int
OpenPOWER on IntegriCloud