2014-07-10 Roland McGrath <roland@hack.frob.com>
+ * nptl/pthread_create.c (start_thread): Use atomic_or and
+ lll_futex_wake directly rather than lll_robust_dead.
+ * sysdeps/unix/sysv/linux/aarch64/lowlevellock.h
+ (lll_robust_dead): Macro removed.
+ * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
+
* nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
Use atomic_compare_and_exchange_val_acq directly rather than
lll_robust_trylock.
# endif
this->__list.__next = NULL;
- lll_robust_dead (this->__lock, /* XYZ */ LLL_SHARED);
+ atomic_or (&this->__lock, FUTEX_OWNER_DIED);
+ lll_futex_wake (this->__lock, 1, /* XYZ */ LLL_SHARED);
}
while (robust != (void *) &pd->robust_head);
}
__ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
__ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
__ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
({ \
})
-#define lll_robust_dead(futex, private) \
- (void) \
- ({ int __ignore; \
- register int _nr asm ("edx") = 1; \
- __asm __volatile (LOCK_INSTR "orl %5, (%2)\n\t" \
- LLL_EBX_LOAD \
- LLL_ENTER_KERNEL \
- LLL_EBX_LOAD \
- : "=a" (__ignore) \
- : "0" (SYS_futex), LLL_EBX_REG (&(futex)), \
- "c" (__lll_private_flag (FUTEX_WAKE, private)), \
- "d" (_nr), "i" (FUTEX_OWNER_DIED), \
- "i" (offsetof (tcbhead_t, sysinfo))); \
- })
-
#define lll_islocked(futex) \
(futex != LLL_LOCK_INITIALIZER)
_r10 == -1 ? -_retval : _retval; \
})
-#define lll_robust_dead(futexv, private) \
-do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- DO_INLINE_SYSCALL(futex, 3, (long) __futexp, \
- __lll_private_flag (FUTEX_WAKE, private), 1); \
- } \
-while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \
({ \
__ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
__ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- INTERNAL_SYSCALL_DECL (__err); \
- int *__futexp = &(futexv); \
- \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- INTERNAL_SYSCALL (futex, __err, 4, __futexp, \
- __lll_private_flag (FUTEX_WAKE, private), 1, 0); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
(nr), 0); \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
if (__result) \
__lll_unlock_wake (__futex, private); })
-#define lll_robust_dead(futex, private) \
- (void) ({ int __ignore, *__futex = &(futex); \
- __asm __volatile ("\
- .align 2\n\
- mova 1f,r0\n\
- mov r15,r1\n\
- mov #-6,r15\n\
- 0: mov.l @%1,%0\n\
- or %2,%0\n\
- mov.l %0,@%1\n\
- 1: mov r1,r15"\
- : "=&r" (__ignore) : "r" (__futex), "r" (FUTEX_OWNER_DIED) \
- : "r0", "r1", "memory"); \
- lll_futex_wake (__futex, 1, private); })
-
# ifdef NEED_SYSCALL_INST_PAD
# define SYSCALL_WITH_INST_PAD "\
trapa #0x14; or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0"
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#ifdef __sparc32_atomic_do_lock
/* Avoid FUTEX_WAKE_OP if supporting pre-v9 CPUs. */
(nr), 0); \
})
-#define lll_robust_dead(futexv, private) \
- do \
- { \
- int *__futexp = &(futexv); \
- atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1, private); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
} \
while (0)
-#define lll_robust_dead(futex, private) \
- do \
- { \
- int ignore; \
- __asm __volatile (LOCK_INSTR "orl %3, (%2)\n\t" \
- "syscall" \
- : "=m" (futex), "=a" (ignore) \
- : "D" (&(futex)), "i" (FUTEX_OWNER_DIED), \
- "S" (__lll_private_flag (FUTEX_WAKE, private)), \
- "1" (__NR_futex), "d" (1) \
- : "cx", "r11", "cc", "memory"); \
- } \
- while (0)
-
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \
({ int __res; \