(pthread_spin_trylock): Add missing lock prefix. Minute optimization.
authordrepper <drepper>
Wed, 27 Nov 2002 23:53:11 +0000 (23:53 +0000)
committerdrepper <drepper>
Wed, 27 Nov 2002 23:53:11 +0000 (23:53 +0000)
nptl/sysdeps/i386/i686/pthread_spin_trylock.S

index 881976c..2ab83e6 100644 (file)
 
 #define EBUSY  16
 
+
+#ifdef UP
+# define LOCK
+#else
+# define LOCK lock
+#endif
+
        .globl  pthread_spin_trylock
        .type   pthread_spin_trylock,@function
        .align  16
@@ -26,9 +33,10 @@ pthread_spin_trylock:
        movl    4(%esp), %edx
        movl    $1, %eax
        xorl    %ecx, %ecx
+       LOCK
        cmpxchgl %ecx, (%edx)
-       movl    $EBUSY, %ecx
-       movl    $0, %eax
-       cmovne  %ecx, %eax
+       movl    $EBUSY, %edx
+       movl    %ecx, %eax
+       cmovne  %edx, %eax
        ret
        .size   pthread_spin_trylock,.-pthread_spin_trylock