mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 15:20:10 +00:00
(__lll_mutex_lock_wait): Optimize a bit more. Just one copy of the atomic instruction needed.
This commit is contained in:
parent
7a49a7d5b7
commit
ebddb42437
@ -51,24 +51,18 @@ __lll_mutex_lock_wait:
|
||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||
|
||||
cmpl %edx, %eax /* NB: %edx == 2 */
|
||||
je 1f
|
||||
|
||||
movl %edx, %eax
|
||||
xchgl %eax, (%ebx) /* NB: lock is implied */
|
||||
|
||||
testl %eax, %eax
|
||||
je 2f
|
||||
jne 2f
|
||||
|
||||
1: movl $SYS_futex, %eax
|
||||
ENTER_KERNEL
|
||||
|
||||
movl %edx, %eax
|
||||
2: movl %edx, %eax
|
||||
xchgl %eax, (%ebx) /* NB: lock is implied */
|
||||
|
||||
testl %eax, %eax
|
||||
jnz,pn 1b
|
||||
|
||||
2: popl %esi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %edx
|
||||
ret
|
||||
|
@ -51,24 +51,18 @@ __lll_mutex_lock_wait:
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
|
||||
cmpl %edx, %eax /* NB: %edx == 2 */
|
||||
je 1f
|
||||
|
||||
movl %edx, %eax
|
||||
xchgl %eax, (%rdi) /* NB: lock is implied */
|
||||
|
||||
testl %eax, %eax
|
||||
je 2f
|
||||
jne 2f
|
||||
|
||||
1: movq $SYS_futex, %rax
|
||||
syscall
|
||||
|
||||
movl %edx, %eax
|
||||
2: movl %edx, %eax
|
||||
xchgl %eax, (%rdi) /* NB: lock is implied */
|
||||
|
||||
testl %eax, %eax
|
||||
jnz 1b
|
||||
|
||||
2: popq %rdx
|
||||
popq %rdx
|
||||
popq %r10
|
||||
retq
|
||||
.size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait
|
||||
|
Loading…
Reference in New Issue
Block a user