aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps/pthread/bits
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-18 01:38:17 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-18 01:38:17 +0000
commit82f81a9086320d12eb2fc45766203954b90461a2 (patch)
treeb2c668e5ee6bc1e9c4176cee394ac7f37b382617 /linuxthreads/sysdeps/pthread/bits
parentf077a4a9f027b938bd091583e3ec34725cba428c (diff)
downloadglibc-82f81a9086320d12eb2fc45766203954b90461a2.zip
glibc-82f81a9086320d12eb2fc45766203954b90461a2.tar.gz
glibc-82f81a9086320d12eb2fc45766203954b90461a2.tar.bz2
Update.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (msgrcv, msgsnd): Make cancelable. * sysdeps/unix/sysv/linux/hppa/syscalls.list (msgrcv, msgsnd): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (msgrcv, msgsnd): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (msgrcv, msgsnd): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (msgrcv, msgsnd): Likewise. * sysdeps/unix/sysv/linux/ia64/sigsuspend.c (__sigsuspend): Likewise.
Diffstat (limited to 'linuxthreads/sysdeps/pthread/bits')
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-lock.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
index ceb08b6..217b0be 100644
--- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
@@ -23,6 +23,10 @@
#include <pthread.h>
+#if defined _LIBC && !defined NOT_IN_libc
+#include <linuxthreads/internals.h>
+#endif
+
/* Mutex type. */
#if defined(_LIBC) || defined(_IO_MTSAFE_IO)
typedef pthread_mutex_t __libc_lock_t;
@@ -90,19 +94,30 @@ typedef pthread_key_t __libc_key_t;
#define _RTLD_LOCK_RECURSIVE_INITIALIZER \
{PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
-#ifdef __PIC__
-# define __libc_maybe_call(FUNC, ARGS, ELSE) \
+#if defined _LIBC && defined IS_IN_libpthread
+# define __libc_maybe_call(FUNC, ARGS, ELSE) FUNC ARGS
+#else
+# ifdef __PIC__
+# 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) \
+# else
+# define __libc_maybe_call(FUNC, ARGS, ELSE) \
(FUNC != NULL ? FUNC ARGS : ELSE)
+# endif
+#endif
+#if defined _LIBC && !defined NOT_IN_libc && defined __PIC__
+# define __libc_maybe_call2(FUNC, ARGS, ELSE) \
+ ({__libc_pthread_functions.ptr_##FUNC != NULL \
+ ? __libc_pthread_functions.ptr_##FUNC ARGS : ELSE; })
+#else
+# define __libc_maybe_call2(FUNC, ARGS, ELSE) __libc_maybe_call (__##FUNC, ARGS, ELSE)
#endif
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#define __libc_lock_init(NAME) \
- (__libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0))
+ (__libc_maybe_call2 (pthread_mutex_init, (&(NAME), NULL), 0))
#define __libc_rwlock_init(NAME) \
(__libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0));
@@ -125,7 +140,7 @@ typedef pthread_key_t __libc_key_t;
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. */
#define __libc_lock_fini(NAME) \
- (__libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0));
+ (__libc_maybe_call2 (pthread_mutex_destroy, (&(NAME)), 0));
#define __libc_rwlock_fini(NAME) \
(__libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0));
@@ -135,7 +150,7 @@ typedef pthread_key_t __libc_key_t;
/* Lock the named lock variable. */
#define __libc_lock_lock(NAME) \
- (__libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0));
+ (__libc_maybe_call2 (pthread_mutex_lock, (&(NAME)), 0));
#define __libc_rwlock_rdlock(NAME) \
(__libc_maybe_call (__pthread_rwlock_rdlock, (&(NAME)), 0));
#define __libc_rwlock_wrlock(NAME) \
@@ -147,7 +162,7 @@ typedef pthread_key_t __libc_key_t;
/* Try to lock the named lock variable. */
#define __libc_lock_trylock(NAME) \
- (__libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0))
+ (__libc_maybe_call2 (pthread_mutex_trylock, (&(NAME)), 0))
#define __libc_rwlock_tryrdlock(NAME) \
(__libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0))
#define __libc_rwlock_trywrlock(NAME) \
@@ -160,7 +175,7 @@ typedef pthread_key_t __libc_key_t;
/* Unlock the named lock variable. */
#define __libc_lock_unlock(NAME) \
- (__libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0));
+ (__libc_maybe_call2 (pthread_mutex_unlock, (&(NAME)), 0));
#define __libc_rwlock_unlock(NAME) \
(__libc_maybe_call (__pthread_rwlock_unlock, (&(NAME)), 0));