From c0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 28 Sep 2000 23:11:33 +0000 Subject: Update. * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP test for owner first. Patch by Kaz Kylheku . --- linuxthreads/mutex.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linuxthreads/mutex.c') diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index 9ce4a30820..9b4a3c7f56 100644 --- a/linuxthreads/mutex.c +++ b/linuxthreads/mutex.c @@ -163,6 +163,8 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex) __pthread_unlock(&mutex->__m_lock); return 0; case PTHREAD_MUTEX_RECURSIVE_NP: + if (mutex->__m_owner != thread_self()) + return EPERM; if (mutex->__m_count > 0) { mutex->__m_count--; return 0; -- cgit v1.2.3