From d3c9f895257e50335e874ca08ad6efcc0abea6d7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 6 Dec 2002 11:49:42 +0000 Subject: Update. 2002-12-06 Ulrich Drepper * misc/syslog.c (log_cleanup): New function. (openlog): Use log_cleanup instead of __libc_mutex_unlock. (closelog): Likewise. * elf/dl-close.c: Use __rtld_lock_* macros instead of __libc_lock_*. * elf/dl-iteratephdr.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-misc.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-support.c: Likewise. * elf/rtld.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/bits/libc-lock.h: Define __rtld_lock_* macros. * sysdeps/mach/bits/libc-lock.h: Likewise. * sysdeps/mach/hurd/bits/libc-lock.h: Likewise. * dirent/bug-readdir1.c (main): Don't call closedir, just close --- linuxthreads/sysdeps/pthread/bits/libc-lock.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'linuxthreads/sysdeps') diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h index c25c038..ceb08b6 100644 --- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h +++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h @@ -32,6 +32,7 @@ typedef pthread_rwlock_t __libc_rwlock_t; # else typedef struct __libc_rwlock_opaque__ __libc_rwlock_t; # endif +typedef __libc_lock_recursive_t __rtld_lock_recursive_t; #else typedef struct __libc_lock_opaque__ __libc_lock_t; typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; @@ -54,6 +55,8 @@ typedef pthread_key_t __libc_key_t; CLASS __libc_rwlock_t NAME; #define __libc_lock_define_recursive(CLASS,NAME) \ CLASS __libc_lock_recursive_t NAME; +#define __rtld_lock_define_recursive(CLASS,NAME) \ + CLASS __rtld_lock_recursive_t NAME; /* Define an initialized lock variable NAME with storage class CLASS. @@ -82,12 +85,17 @@ typedef pthread_key_t __libc_key_t; #define _LIBC_LOCK_RECURSIVE_INITIALIZER \ {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP} +#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \ + CLASS __rtld_lock_recursive_t NAME = _RTLD_LOCK_RECURSIVE_INITIALIZER; +#define _RTLD_LOCK_RECURSIVE_INITIALIZER \ + {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP} + #ifdef __PIC__ -#define __libc_maybe_call(FUNC, ARGS, ELSE) \ +# define __libc_maybe_call(FUNC, ARGS, ELSE) \ (__extension__ ({ __typeof (FUNC) *_fn = (FUNC); \ _fn != NULL ? (*_fn) ARGS : ELSE; })) #else -#define __libc_maybe_call(FUNC, ARGS, ELSE) \ +# define __libc_maybe_call(FUNC, ARGS, ELSE) \ (FUNC != NULL ? FUNC ARGS : ELSE) #endif @@ -110,6 +118,8 @@ typedef pthread_key_t __libc_key_t; __pthread_mutexattr_destroy (&__attr); \ } \ } while (0); +#define __rtld_lock_init_recursive(NAME) \ + __libc_lock_init_recursive (NAME) /* Finalize the named lock variable, which must be locked. It cannot be used again until __libc_lock_init is called again on it. This must be @@ -121,6 +131,7 @@ typedef pthread_key_t __libc_key_t; /* Finalize recursive named lock. */ #define __libc_lock_fini_recursive(NAME) __libc_lock_fini ((NAME).mutex) +#define __rtld_lock_fini_recursive(NAME) __libc_lock_fini_recursive (NAME) /* Lock the named lock variable. */ #define __libc_lock_lock(NAME) \ @@ -132,6 +143,7 @@ typedef pthread_key_t __libc_key_t; /* Lock the recursive named lock variable. */ #define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex) +#define __rtld_lock_lock_recursive(NAME) __libc_lock_lock_recursive (NAME) /* Try to lock the named lock variable. */ #define __libc_lock_trylock(NAME) \ @@ -143,6 +155,8 @@ typedef pthread_key_t __libc_key_t; /* Try to lock the recursive named lock variable. */ #define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock ((NAME).mutex) +#define __rtld_lock_trylock_recursive(NAME) \ + __libc_lock_trylock_recursive (NAME) /* Unlock the named lock variable. */ #define __libc_lock_unlock(NAME) \ @@ -152,6 +166,7 @@ typedef pthread_key_t __libc_key_t; /* Unlock the recursive named lock variable. */ #define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex) +#define __rtld_lock_unlock_recursive(NAME) __libc_lock_unlock_recursive (NAME) /* Define once control variable. */ -- cgit v1.1