mirror of git://gcc.gnu.org/git/gcc.git
SyncTest.java (run): Cache .class value.
2003-07-09 Jeff Sturm <jsturm@one-point.com> * libjava.lang/SyncTest.java (run): Cache .class value. From-SVN: r69153
This commit is contained in:
parent
4a2e29161f
commit
cd61dacbc8
|
|
@ -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>
|
2003-06-08 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
* libjava.lang/MathBuiltin.java: New test case.
|
* libjava.lang/MathBuiltin.java: New test case.
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,11 @@ public class SyncTest implements Runnable {
|
||||||
static int counter;
|
static int counter;
|
||||||
|
|
||||||
public void run() {
|
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++)
|
for (int n = 0; n < 1000000; n++)
|
||||||
synchronized (SyncTest.class) {
|
synchronized (lock) {
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue