diff options
-rw-r--r-- | libjava/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/SyncTest.java | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog index ac9493b..1771b13 100644 --- a/libjava/testsuite/ChangeLog +++ b/libjava/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-07-09 Jeff Sturm <jsturm@one-point.com> + + * libjava.lang/SyncTest.java (run): Cache .class value. + 2003-06-08 Roger Sayle <roger@eyesopen.com> * libjava.lang/MathBuiltin.java: New test case. diff --git a/libjava/testsuite/libjava.lang/SyncTest.java b/libjava/testsuite/libjava.lang/SyncTest.java index 7cb6a56..85573f8 100644 --- a/libjava/testsuite/libjava.lang/SyncTest.java +++ b/libjava/testsuite/libjava.lang/SyncTest.java @@ -3,8 +3,11 @@ public class SyncTest implements Runnable { 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++; } } |