about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-18 18:10:57 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-18 18:10:57 +0000
commitf6c93bd9c82f9feabb171567fb0b25777997d7f6 (patch)
tree12b8f8b0aa89c418c0d6d6cd9ab2469eecd0b8dc /nptl
parentfae49c6287347a588cbc9e454fa000499210046e (diff)
downloadglibc-f6c93bd9c82f9feabb171567fb0b25777997d7f6.tar.gz
glibc-f6c93bd9c82f9feabb171567fb0b25777997d7f6.tar.xz
glibc-f6c93bd9c82f9feabb171567fb0b25777997d7f6.zip
Update.
2003-06-18  Ulrich Drepper  <drepper@redhat.com>

	* pthread_mutex_destroy.c (__pthread_mutex_destroy): For
	error-checking mutex detect busy mutexes.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/pthread_mutex_destroy.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index b2af00f1cd..4c44cec0a2 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-18  Ulrich Drepper  <drepper@redhat.com>
+
+	* pthread_mutex_destroy.c (__pthread_mutex_destroy): For
+	error-checking mutex detect busy mutexes.
+
 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
diff --git a/nptl/pthread_mutex_destroy.c b/nptl/pthread_mutex_destroy.c
index a86ff27461..dec390c552 100644
--- a/nptl/pthread_mutex_destroy.c
+++ b/nptl/pthread_mutex_destroy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include "pthreadP.h"
 
 
@@ -24,6 +25,11 @@ int
 __pthread_mutex_destroy (mutex)
      pthread_mutex_t *mutex;
 {
+  if (__builtin_expect (mutex->__data.__kind == PTHREAD_MUTEX_ERRORCHECK_NP,
+			0)
+      && lll_mutex_trylock (mutex->__data.__lock) != 0)
+    return EBUSY;
+
   return 0;
 }
 strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)