summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libkse/thread/thr_mutex.c2
-rw-r--r--lib/libpthread/thread/thr_mutex.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c
index 017baeb..464bc39 100644
--- a/lib/libkse/thread/thr_mutex.c
+++ b/lib/libkse/thread/thr_mutex.c
@@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m,
} while (((*m)->m_owner != curthread) && (ret == 0) &&
(curthread->interrupted == 0) && (curthread->timeout == 0));
- if (ret == 0 && curthread->timeout)
+ if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout)
ret = ETIMEDOUT;
/*
diff --git a/lib/libpthread/thread/thr_mutex.c b/lib/libpthread/thread/thr_mutex.c
index 017baeb..464bc39 100644
--- a/lib/libpthread/thread/thr_mutex.c
+++ b/lib/libpthread/thread/thr_mutex.c
@@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m,
} while (((*m)->m_owner != curthread) && (ret == 0) &&
(curthread->interrupted == 0) && (curthread->timeout == 0));
- if (ret == 0 && curthread->timeout)
+ if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout)
ret = ETIMEDOUT;
/*
OpenPOWER on IntegriCloud