+2002-12-06 Ulrich Drepper <drepper@redhat.com>
+
+ * 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.
+
2002-12-06 Roland McGrath <roland@redhat.com>
* sysdeps/generic/libc-tls.c (__libc_setup_tls): Cope with zero ALIGN.
2002-12-05 Ulrich Drepper <drepper@redhat.com>
- * dirent/bug-readdir1.c (main): Don't call closedir, just close on
+ * dirent/bug-readdir1.c (main): Don't call closedir, just close
the file descriptor. This is testing what the bug report was about.
2002-12-04 Ulrich Drepper <drepper@redhat.com>
of libc. */
#define __libc_lock_define(CLASS,NAME)
#define __libc_lock_define_recursive(CLASS,NAME)
+#define __rtld_lock_define_recursive(CLASS,NAME)
#define __libc_rwlock_define(CLASS,NAME)
/* Define an initialized lock variable NAME with storage class CLASS. */
/* Same as last but this time we initialize a recursive mutex. */
#define __libc_lock_init_recursive(NAME)
+#define __rtld_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
/* Lock the recursive named lock variable. */
#define __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_lock_recursive(NAME)
/* Try to lock the named lock variable. */
#define __libc_lock_trylock(NAME) 0
/* Unlock the recursive named lock variable. */
#define __libc_lock_unlock_recursive(NAME)
+#define __rtld_lock_unlock_recursive(NAME)
/* Define once control variable. */
_dl_signal_error (0, map->l_name, NULL, N_("shared object not open"));
/* Acquire the lock. */
- __libc_lock_lock_recursive (GL(dl_load_lock));
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
/* Decrement the reference count. */
if (map->l_opencount > 1 || map->l_type != lt_loaded)
/* One decrement the object itself, not the dependencies. */
--map->l_opencount;
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
return;
}
free (list);
/* Release the lock. */
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
}
libc_hidden_def (_dl_close)
int ret = 0;
/* Make sure we are alone. */
- __libc_lock_lock_recursive (GL(dl_load_lock));
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
for (l = GL(dl_loaded); l != NULL; l = l->l_next)
{
}
/* Release the lock. */
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
return ret;
}
return 0;
/* Make sure nobody can unload the object while we are at it. */
- __libc_lock_lock_recursive (GL(dl_load_lock));
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
/* Determine whether UNDEF_MAP already has a reference to MAP. First
look in the normal dependencies. */
out:
/* Release the lock. */
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
return result;
}
__writev (fd, iov, niov);
else
{
- __libc_lock_lock_recursive (GL(dl_load_lock));
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
__writev (fd, iov, niov);
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
}
#else
__writev (fd, iov, niov);
_dl_signal_error (EINVAL, file, NULL, N_("invalid mode for dlopen()"));
/* Make sure we are alone. */
- __libc_lock_lock_recursive (GL(dl_load_lock));
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
args.file = file;
args.mode = mode;
#endif
/* Release the lock. */
- __libc_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
if (__builtin_expect (errstring != NULL, 0))
{
This must be a recursive lock since the initializer function of
the loaded object might as well require a call to this function.
At this time it is not anymore a problem to modify the tables. */
-__libc_lock_define_initialized_recursive (, _dl_load_lock)
+__rtld_lock_define_initialized_recursive (, _dl_load_lock)
#ifdef HAVE_AUX_VECTOR
._dl_correct_cache_id = _DL_CACHE_DEFAULT_ID,
._dl_hwcap_mask = HWCAP_IMPORTANT,
#ifdef _LIBC_REENTRANT
- ._dl_load_lock = _LIBC_LOCK_RECURSIVE_INITIALIZER
+ ._dl_load_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER
#endif
};
strong_alias (_rtld_global, _rtld_local);
+2002-12-06 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
+
2002-12-05 Roland McGrath <roland@redhat.com>
* pthread.c (__pthread_initialize_minimal)
# 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;
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.
#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
__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
/* 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) \
/* 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) \
/* 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) \
/* 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. */
+2002-12-06 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile (tests): Comment out tst-locale2 for now.
+ (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
+
+ * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
+ -D_IO_MTSAFE_IO.
+ * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
+ Use _IO_lock_init instead of explicit assignment.
+
+ * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
+ Define __libc_lock_* and __libc_lock_recursive macros with
+ lowlevellock macros, not pthread mutexes.
+
+ * flockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_lock instead
+ of pthread_mutex_lock.
+ * funlockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_unlock
+ instead of pthread_mutex_unlock.
+
2002-12-06 Roland McGrath <roland@redhat.com>
* allocatestack.c (__stack_user): Use uninitialized defn.
tst-stack1 \
tst-unload \
tst-sysconf \
- tst-locale1 tst-locale2
+ tst-locale1 #tst-locale2 <--- commented out until compiler is fixed
LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
endif
+CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
+CFLAGS-funlockfile.c = -D_IO_MTSAFE_IO
+
ifeq ($(build-static),yes)
tests-static += tst-locale1 tst-locale2
endif
#include <pthread.h>
#include <stdio.h>
#include <libio.h>
+#include <bits/stdio-lock.h>
void
flockfile (stream)
FILE *stream;
{
- pthread_mutex_lock (stream->_lock);
+ _IO_lock_lock (*stream->_lock);
}
strong_alias (flockfile, _IO_flockfile)
#include <pthread.h>
#include <stdio.h>
#include <libio.h>
+#include <bits/stdio-lock.h>
void
funlockfile (stream)
FILE *stream;
{
- pthread_mutex_unlock (stream->_lock);
+ _IO_lock_unlock (*stream->_lock);
}
strong_alias (funlockfile, _IO_funlockfile)
ld.so might be used on old kernels with a different libc.so. */
#ifdef _LIBC
# include <lowlevellock.h>
+# include <tls.h>
#endif
/* Mutex type. */
#if defined _LIBC || defined _IO_MTSAFE_IO
-# if defined NOT_IN_libc || !defined _LIBC
+# if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC
typedef pthread_mutex_t __libc_lock_t;
+typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
# else
typedef int __libc_lock_t;
+typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
# endif
-typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
# ifdef __USE_UNIX98
typedef pthread_rwlock_t __libc_rwlock_t;
# else
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.
initialized locks must be set to one due to the lack of normal
atomic operations.) */
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# if LLL_LOCK_INITIALIZER == 0
# define __libc_lock_define_initialized(CLASS,NAME) \
CLASS __libc_lock_t NAME;
/* Define an initialized recursive lock variable NAME with storage
class CLASS. */
-#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# if LLL_LOCK_INITIALIZER == 0
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME;
+# else
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+# endif
+# define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+ { LLL_LOCK_INITIALIZER, 0, NULL }
+#else
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
-#define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+# define _LIBC_LOCK_RECURSIVE_INITIALIZER \
{PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
+#endif
+#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}
/* If we check for a weakly referenced symbol and then perform a
normal jump to it te code generated for some platforms in case of
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_init(NAME) (NAME) = LLL_LOCK_INITIALIZER;
#else
# define __libc_lock_init(NAME) \
__libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0)
/* Same as last but this time we initialize a recursive mutex. */
-#define __libc_lock_init_recursive(NAME) \
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_init_recursive(NAME) \
+ (NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER
+#else
+# define __libc_lock_init_recursive(NAME) \
+ do { \
+ if (__pthread_mutex_init != NULL) \
+ { \
+ pthread_mutexattr_t __attr; \
+ __pthread_mutexattr_init (&__attr); \
+ __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
+ __pthread_mutex_init (&(NAME).mutex, &__attr); \
+ __pthread_mutexattr_destroy (&__attr); \
+ } \
+ } while (0)
+#endif
+
+#define __rtld_lock_init_recursive(NAME) \
do { \
if (__pthread_mutex_init != NULL) \
{ \
pthread_mutexattr_t __attr; \
__pthread_mutexattr_init (&__attr); \
- __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
+ __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
__pthread_mutex_init (&(NAME).mutex, &__attr); \
__pthread_mutexattr_destroy (&__attr); \
} \
- } while (0);
+ } while (0)
/* 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
called on a lock variable before the containing storage is reused. */
-#if defined _LIBC && !defined NOT_IN_libc
-# define __libc_lock_fini(NAME) (0)
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_fini(NAME) ((void) 0)
#else
# define __libc_lock_fini(NAME) \
__libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
__libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0)
/* Finalize recursive named lock. */
-#define __libc_lock_fini_recursive(NAME) \
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_fini_recursive(NAME) ((void) 0)
+#else
+# define __libc_lock_fini_recursive(NAME) \
__libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
+#endif
/* Lock the named lock variable. */
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_lock(NAME) \
lll_lock (NAME);
#else
__libc_maybe_call (__pthread_rwlock_wrlock, (&(NAME)), 0)
/* Lock the recursive named lock variable. */
-#define __libc_lock_lock_recursive(NAME) \
- __libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_lock_recursive(NAME) \
+ do { \
+ void *self = THREAD_SELF; \
+ if ((NAME).owner != self) \
+ { \
+ lll_lock ((NAME).lock); \
+ (NAME).owner = self; \
+ } \
+ ++(NAME).cnt; \
+ } while (0)
+#else
+# define __libc_lock_lock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+#endif
+
+#define __rtld_lock_lock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
/* Try to lock the named lock variable. */
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_trylock(NAME) \
lll_trylock (NAME)
#else
__libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0)
/* Try to lock the recursive named lock variable. */
-#define __libc_lock_trylock_recursive(NAME) \
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_trylock_recursive(NAME) \
+ do { \
+ int result = 0; \
+ void *self = THREAD_SELF; \
+ if ((NAME).owner != self) \
+ { \
+ if (lll_trylock ((NAME).lock) == 0) \
+ { \
+ (NAME).owner = self; \
+ (NAME).cnt = 1; \
+ } \
+ else \
+ result = EBUSY; \
+ } \
+ else \
+ ++(NAME).cnt; \
+ } while (0)
+#else
+# define __libc_lock_trylock_recursive(NAME) \
__libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
+#endif
+
+#define __rtld_lock_trylock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
/* Unlock the named lock variable. */
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_unlock(NAME) \
lll_unlock (NAME);
#else
__libc_maybe_call (__pthread_rwlock_unlock, (&(NAME)), 0)
/* Unlock the recursive named lock variable. */
-#define __libc_lock_unlock_recursive(NAME) \
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+/* We do no error checking here. */
+# define __libc_lock_unlock_recursive(NAME) \
+ do { \
+ if (--(NAME).cnt == 0) \
+ { \
+ (NAME).owner = NULL; \
+ lll_unlock ((NAME).lock); \
+ } \
+ } while (0)
+#else
+# define __libc_lock_unlock_recursive(NAME) \
__libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
+#endif
+#define __rtld_lock_unlock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
/* Define once control variable. */
#if PTHREAD_ONCE_INIT == 0
# endif
#endif
-/* We need portable names for some functions. E.g., when they are
- used as argument to __libc_cleanup_region_start. */
-#define __libc_mutex_unlock __pthread_mutex_unlock
-
#endif /* bits/libc-lock.h */
libpthread-sysdep_routines += pt-fork
endif
+
+ifeq ($(subdir),posix)
+CFLAGS-fork.c = -D_IO_MTSAFE_IO
+endif
#include <libio/libioP.h>
#include <tls.h>
#include "fork.h"
+#include <bits/stdio-lock.h>
unsigned long int *__fork_generation_pointer;
_IO_ITER i;
for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
- *((pthread_mutex_t *) _IO_iter_file(i)->_lock)
- = (pthread_mutex_t) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+ _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
}
of libc. */
#define __libc_lock_define(CLASS,NAME)
#define __libc_lock_define_recursive(CLASS,NAME)
+#define __rtld_lock_define_recursive(CLASS,NAME)
#define __libc_rwlock_define(CLASS,NAME)
/* Define an initialized lock variable NAME with storage class CLASS. */
/* Same as last but this time we initialize a recursive mutex. */
#define __libc_lock_init_recursive(NAME)
+#define __rtld_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
/* Lock the recursive named lock variable. */
#define __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_lock_recursive(NAME)
/* Try to lock the named lock variable. */
#define __libc_lock_trylock(NAME) 0
/* Unlock the recursive named lock variable. */
#define __libc_lock_unlock_recursive(NAME)
+#define __rtld_lock_unlock_recursive(NAME)
/* Define once control variable. */
This must be a recursive lock since the initializer function of
the loaded object might as well require a call to this function.
At this time it is not anymore a problem to modify the tables. */
- __libc_lock_define_recursive (EXTERN, _dl_load_lock)
+ __rtld_lock_define_recursive (EXTERN, _dl_load_lock)
/* OS version. */
EXTERN unsigned int _dl_osversion;
/* libc-internal interface for mutex locks. Mach cthreads version.
- Copyright (C) 1996,97,98,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,98,2000,01, 2002 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
#define __libc_lock_unlock_recursive __libc_lock_unlock
#define __libc_lock_lock_recursive __libc_lock_lock
+#define __rtld_lock_define_initialized_recursive __libc_lock_define_initialized
+#define __rtld_lock_init_recursive __libc_lock_init
+#define __rtld_lock_fini_recursive __libc_lock_fini
+#define __rtld_lock_trylock_recursive __libc_lock_trylock
+#define __rtld_lock_unlock_recursive __libc_lock_unlock
+#define __rtld_lock_lock_recursive __libc_lock_lock
+
#endif /* bits/libc-lock.h */
/* libc-internal interface for mutex locks. Hurd version using Mach cthreads.
- Copyright (C) 1996,97,98,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,98,2000,01, 2002 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
called on a lock variable before the containing storage is reused. */
#define __libc_lock_fini(NAME) __mutex_unlock (&(NAME))
#define __libc_lock_fini_recursive(NAME) __mutex_unlock (&(NAME).mutex)
+#define __rtld_lock_fini_recursive(NAME) __mutex_unlock (&(NAME).mutex)
/* Lock the named lock variable. */
#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+#define __rtld_lock_define_recursive(CLASS,NAME) \
+ __libc_lock_define_recursive (CLASS, NAME)
+#define _RTLD_LOCK_RECURSIVE_INITIALIZER \
+ _LIBC_LOCK_RECURSIVE_INITIALIZER
+#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \
+ __libc_lock_define_initialized_recursive (CLASS, NAME)
+
#define __libc_lock_init_recursive(NAME) \
({ __libc_lock_recursive_t *const __lock = &(NAME); \
__lock->owner = 0; mutex_init (&__lock->mutex); })
})
+#define __rtld_lock_init_recursive(NAME) \
+ __libc_lock_init_recursive (NAME)
+#define __rtld_lock_trylock_recursive(NAME) \
+ __libc_lock_trylock_recursive (NAME)
+#define __rtld_lock_lock_recursive(NAME) \
+ __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_unlock_recursive(NAME) \
+ __libc_lock_unlock_recursive (NAME)
+
+
/* XXX for now */
#define __libc_rwlock_define __libc_lock_define
#define __libc_rwlock_define_initialized __libc_lock_define_initialized