summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index c6c80b4..aa3a96f 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -64,6 +64,7 @@
*/
static int get_muncontested(pthread_mutex_t, int);
static void get_mcontested(pthread_mutex_t);
+static int mutex_lock_common(pthread_mutex_t *, int);
static inline int mutex_self_trylock(pthread_mutex_t);
static inline int mutex_self_lock(pthread_mutex_t);
static inline int mutex_unlock_common(pthread_mutex_t *, int);
@@ -1381,13 +1382,14 @@ mutex_queue_enq(pthread_mutex_t mutex, pthread_t pthread)
static int
get_muncontested(pthread_mutex_t mutexp, int nonblock)
{
- if (mutexp->m_owner != NULL && mutexp->m_owner != curthread)
+ if (mutexp->m_owner != NULL && mutexp->m_owner != curthread) {
return (-1);
- else if (mutexp->m_owner == curthread)
+ } else if (mutexp->m_owner == curthread) {
if (nonblock)
return (mutex_self_trylock(mutexp));
else
return (mutex_self_lock(mutexp));
+ }
/*
* The mutex belongs to this thread now. Mark it as
OpenPOWER on IntegriCloud