diff options
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S index 35f61bf0f9..839a5eb336 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S @@ -44,12 +44,13 @@ __pthread_rwlock_unlock: movl 12(%esp), %edi /* Get the lock. */ - movl $1, %eax + movl $1, %edx + xorl %eax, %eax LOCK #if MUTEX == 0 - xaddl %eax, (%edi) + cmpxchgl %edx, (%edi) #else - xaddl %eax, MUTEX(%edi) + cmpxchgl %edx, MUTEX(%edi) #endif testl %eax, %eax jne 1f |