From: Ulrich Drepper Date: Wed, 18 Jun 2003 18:10:57 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2_3_3~567 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6c93bd9c82f9feabb171567fb0b25777997d7f6;p=platform%2Fupstream%2Fglibc.git Update. 2003-06-18 Ulrich Drepper * pthread_mutex_destroy.c (__pthread_mutex_destroy): For error-checking mutex detect busy mutexes. --- diff --git a/intl/localealias.c b/intl/localealias.c index 324f2fe..ed8747d 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -344,7 +344,7 @@ read_alias_file (fname, fname_len) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; - while (strchr (buf, '\n') == NULL) + while (strchr (buf, '\n') == NULL); } /* Should we test for ferror()? I think we have to silently ignore diff --git a/nptl/ChangeLog b/nptl/ChangeLog index b2af00f..4c44cec 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2003-06-18 Ulrich Drepper + + * pthread_mutex_destroy.c (__pthread_mutex_destroy): For + error-checking mutex detect busy mutexes. + 2003-06-17 Ulrich Drepper * 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 a86ff27..dec390c 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 , 2002. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #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)