diff options
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h | 8 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/lowlevellock.c | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h index b7f018b9a1..47174700d0 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h @@ -54,7 +54,7 @@ ({ \ register long int __o0 asm ("out0") = (long int) (futex); \ register long int __o1 asm ("out1") = FUTEX_WAIT; \ - register long int __o2 asm ("out2") = (long int) (val); \ + register int __o2 asm ("out2") = (int) (val); \ register long int __o3 asm ("out3") = (long int) (timespec); \ register long int __r8 asm ("r8"); \ register long int __r10 asm ("r10"); \ @@ -74,7 +74,7 @@ ({ \ register long int __o0 asm ("out0") = (long int) (futex); \ register long int __o1 asm ("out1") = FUTEX_WAKE; \ - register long int __o2 asm ("out2") = (long int) (nr); \ + register int __o2 asm ("out2") = (int) (nr); \ register long int __r8 asm ("r8"); \ register long int __r10 asm ("r10"); \ register long int __r15 asm ("r15") = SYS_futex; \ @@ -93,8 +93,8 @@ ({ \ register long int __o0 asm ("out0") = (long int) (futex); \ register long int __o1 asm ("out1") = FUTEX_REQUEUE; \ - register long int __o2 asm ("out2") = (long int) (nr_wake); \ - register long int __o3 asm ("out3") = (long int) (nr_move); \ + register int __o2 asm ("out2") = (int) (nr_wake); \ + register int __o3 asm ("out3") = (int) (nr_move); \ register long int __o4 asm ("out4") = (long int) (mutex); \ register long int __r8 asm ("r8"); \ register long int __r10 asm ("r10"); \ diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c index db10573a45..eb3e689b9e 100644 --- a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c +++ b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c @@ -27,13 +27,15 @@ void __lll_lock_wait (int *futex, int val) { + /* In the loop we are going to add 2 instead of 1 which is what + the caller did. Account for that. */ + --val; do { - lll_futex_wait (futex, val + 1); - val = atomic_exchange_and_add (futex, 1); + lll_futex_wait (futex, val + 2); + val = atomic_exchange_and_add (futex, 2); } while (val != 0); - *futex = 2; } hidden_proto (__lll_lock_wait) |