This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: small test suite change


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++;
       }
   }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]