2003-06-18  Ulrich Drepper  <drepper@redhat.com>

	* pthread_mutex_destroy.c (__pthread_mutex_destroy): For
	error-checking mutex detect busy mutexes.
This commit is contained in:
Ulrich Drepper 2003-06-18 18:10:57 +00:00
parent fae49c6287
commit f6c93bd9c8
3 changed files with 13 additions and 2 deletions

View File

@ -344,7 +344,7 @@ read_alias_file (fname, fname_len)
/* Make sure the inner loop will be left. The outer loop /* Make sure the inner loop will be left. The outer loop
will exit at the `feof' test. */ will exit at the `feof' test. */
break; break;
while (strchr (buf, '\n') == NULL) while (strchr (buf, '\n') == NULL);
} }
/* Should we test for ferror()? I think we have to silently ignore /* Should we test for ferror()? I think we have to silently ignore

View File

@ -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> 2003-06-17 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock): * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):

View File

@ -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. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */ 02111-1307 USA. */
#include <errno.h>
#include "pthreadP.h" #include "pthreadP.h"
@ -24,6 +25,11 @@ int
__pthread_mutex_destroy (mutex) __pthread_mutex_destroy (mutex)
pthread_mutex_t *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; return 0;
} }
strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy) strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)