diff options
-rw-r--r-- | lib/libthr/thread/thr_mutex.c | 2 | ||||
-rw-r--r-- | tools/regression/pthread/mutex_islocked_np/mutex_islocked_np.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 032f2e3..9b6c21b 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -877,5 +877,5 @@ _pthread_mutex_islocked_np(pthread_mutex_t *mutex) if (__predict_false(ret)) return (ret); } - return ((*mutex)->m_qe.tqe_prev != NULL); + return ((*mutex)->m_lock.m_owner == TID(curthread)); } diff --git a/tools/regression/pthread/mutex_islocked_np/mutex_islocked_np.c b/tools/regression/pthread/mutex_islocked_np/mutex_islocked_np.c index 3e467a1..5ab7e33 100644 --- a/tools/regression/pthread/mutex_islocked_np/mutex_islocked_np.c +++ b/tools/regression/pthread/mutex_islocked_np/mutex_islocked_np.c @@ -37,8 +37,8 @@ thread(void *arg) { pthread_mutex_t *mtx = arg; - if (pthread_mutex_islocked_np(mtx) == 0) { - printf("pthread_mutex_islocked_np() returned zero\n" + if (pthread_mutex_islocked_np(mtx) != 0) { + printf("pthread_mutex_islocked_np() returned non-zero\n" "for a mutex held by another thread\n"); exit(1); } |