diff options
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S index 1b2731a29e..2a2f847684 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S @@ -46,22 +46,24 @@ __lll_mutex_lock_wait: pushq %r10 pushq %rdx + /* In the loop we are going to add 2 instead of 1 which is what + the caller did. Account for that. */ + decq %rsi + xorq %r10, %r10 /* No timeout. */ 1: - leaq 1(%rsi), %rdx /* account for the preceeded xadd. */ + leaq 2(%rsi), %rdx /* account for the preceeded xadd. */ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */ movq $SYS_futex, %rax syscall - movl $1, %esi + movl $2, %esi LOCK xaddl %esi, (%rdi) testl %esi, %esi jne 1b - movl $2, (%rdi) - popq %rdx popq %r10 retq |