aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/mutex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-28 23:11:33 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-28 23:11:33 +0000
commitc0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed (patch)
tree428164e4a1b3ba35e5469c2d21aeb5c84afa8003 /linuxthreads/mutex.c
parent8cab1d380a9a9743ed825533f389e0edb7b777d0 (diff)
downloadglibc-c0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed.tar
glibc-c0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed.tar.gz
glibc-c0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed.tar.bz2
glibc-c0ac34e4472e5f3b5fdf1557480e2b2c1cc72aed.zip
Update.
* mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP test for owner first. Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
Diffstat (limited to 'linuxthreads/mutex.c')
-rw-r--r--linuxthreads/mutex.c2
1 files changed, 2 insertions, 0 deletions
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;