last call
kaz Kojima
kkojima@rr.iij4u.or.jp
Tue Apr 10 16:27:00 GMT 2001
Hi,
I've found a few reverse tests in the spinlock implementation of
the linuxthreads for SH.
kaz
--
2001-04-10 kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
test.
(__pthread_spin_trylock): Likewise.
* sysdeps/sh/pt-machine.h (testandset): Likewise.
Index: pspinlock.c
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/sh/pspinlock.c,v
retrieving revision 1.2
diff -u -r1.2 pspinlock.c
--- pspinlock.c 2000/12/27 17:17:16 1.2
+++ pspinlock.c 2001/04/10 22:59:44
@@ -1,5 +1,5 @@
/* POSIX spinlock implementation. SH version.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@
: "=r" (val)
: "r" (lock)
: "memory");
- while (val != 0);
+ while (val == 0);
return 0;
}
@@ -47,7 +47,7 @@
: "=r" (val)
: "r" (lock)
: "memory");
- return val ? EBUSY : 0;
+ return val ? 0 : EBUSY;
}
weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
Index: pt-machine.h
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/sh/pt-machine.h,v
retrieving revision 1.3
diff -u -r1.3 pt-machine.h
--- pt-machine.h 2000/12/18 05:55:14 1.3
+++ pt-machine.h 2001/04/10 22:59:46
@@ -1,6 +1,6 @@
/* Machine-dependent pthreads configuration and inline functions.
SuperH version.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Niibe Yutaka <gniibe@m17n.org>.
@@ -32,11 +32,11 @@
__asm__ __volatile__(
"tas.b @%1\n\t"
"movt %0"
- : "=z" (ret)
+ : "=r" (ret)
: "r" (spinlock)
: "memory", "cc");
- return ret;
+ return (ret == 0);
}
More information about the Libc-hacker
mailing list