From e48957feb55420710f89d88ca5a45ce08551ff12 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Sun, 1 Jun 2008 20:25:36 +0000 Subject: 2008-06-01 Neal H. Walfield * include/pthread/pthread.h (PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP): New definition. * sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_RECURSIVE_INITIALIZER): New definition. * sysdeps/generic/bits/mutex-attr.h (__pthread_recursive_mutexattr): New definition. * sysdeps/generic/pt-mutexattr.c (__pthread_recursive_mutexattr): New declaration. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): If ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't allocate a copy, just save in MUTEX->ATTR. * sysdeps/generic/pt-mutex-destroy.c (_pthread_mutex_destroy): If MUTEX->ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't free it. --- sysdeps/generic/pt-mutex-destroy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sysdeps/generic/pt-mutex-destroy.c') diff --git a/sysdeps/generic/pt-mutex-destroy.c b/sysdeps/generic/pt-mutex-destroy.c index 72faefe..0c9d514 100644 --- a/sysdeps/generic/pt-mutex-destroy.c +++ b/sysdeps/generic/pt-mutex-destroy.c @@ -1,5 +1,5 @@ /* Destroy a mutex. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. + Copyright (C) 2000,02, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,10 @@ int _pthread_mutex_destroy (pthread_mutex_t *mutex) { - if (mutex->attr) + if (mutex->attr == &__pthread_recursive_mutexattr) + /* Static attributes. */ + ; + else free (mutex->attr); return 0; -- cgit v1.2.3