From eb4e0abb406333e563e1ea9c41f4c04dfa9d1676 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 8 Sep 2005 17:39:04 +0000 Subject: [PATCH] (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define. (lll_futex_wake_unlock): Define. --- sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h index fd4a7ca..ab325d2 100644 --- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -31,6 +31,8 @@ #define FUTEX_WAKE 1 #define FUTEX_REQUEUE 3 #define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) /* Initializer for compatibility lock. */ #define LLL_MUTEX_LOCK_INITIALIZER (0) @@ -73,6 +75,20 @@ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ }) +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, \ + (futexp), FUTEX_WAKE_OP, (nr_wake), \ + (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + + + static inline int __attribute__((always_inline)) __lll_mutex_trylock(int *futex) -- 2.7.4