This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: small test suite change
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: 09 Jul 2003 14:57:30 -0600
- Subject: Patch: FYI: small test suite change
- Reply-to: tromey at redhat dot com
I'm checking this in.
I think Jeff Sturm wrote this, so I put his name on it. Maybe I'm
wrong.
Anyway, this makes one of the tests a little more efficient, so we
don't time out when running it in the interpreter.
Tom
Index: ChangeLog
from Jeff Sturm <jsturm@one-point.com>
* libjava.lang/SyncTest.java (run): Cache .class value.
Index: libjava.lang/SyncTest.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.lang/SyncTest.java,v
retrieving revision 1.1
diff -u -r1.1 SyncTest.java
--- libjava.lang/SyncTest.java 31 Jul 2001 02:13:46 -0000 1.1
+++ libjava.lang/SyncTest.java 9 Jul 2003 21:05:23 -0000
@@ -3,8 +3,11 @@
static int counter;
public void run() {
+ // We cache the .class value; otherwise this code is
+ // slow enough that it will time out in some situations.
+ Object lock = SyncTest.class;
for (int n = 0; n < 1000000; n++)
- synchronized (SyncTest.class) {
+ synchronized (lock) {
counter++;
}
}