diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-04 17:54:56 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-04 17:54:56 +0000 |
commit | 1af26440b28d4d14479ad1ff1e6b859d5a746452 (patch) | |
tree | 8e1d1816291f3aaa4fb7975ed50aa7c29fe96e38 /libjava | |
parent | 244c3f18b62e1212d8475d74e62280006c8dd797 (diff) | |
download | gcc-1af26440b28d4d14479ad1ff1e6b859d5a746452.tar.gz |
2007-09-04 Andrew Haley <aph@redhat.com>
PR java/27908
* testsuite/libjava.lang/PR27908.java
({run1,run2,run3}.isRunning): New Method.
(main): Fix race condition.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/testsuite/libjava.lang/Foo.class | bin | 0 -> 390 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.lang/PR27908.jar | bin | 2452 -> 2718 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.lang/PR27908.java | 18 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/WalkerTest.jar | bin | 0 -> 1210 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.lang/WalkerTest.java | 15 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/WalkerTest.out | 1 |
6 files changed, 33 insertions, 1 deletions
diff --git a/libjava/testsuite/libjava.lang/Foo.class b/libjava/testsuite/libjava.lang/Foo.class Binary files differnew file mode 100644 index 00000000000..b51c95fceb6 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Foo.class diff --git a/libjava/testsuite/libjava.lang/PR27908.jar b/libjava/testsuite/libjava.lang/PR27908.jar Binary files differindex e2804073642..1ec1127ddcb 100644 --- a/libjava/testsuite/libjava.lang/PR27908.jar +++ b/libjava/testsuite/libjava.lang/PR27908.jar diff --git a/libjava/testsuite/libjava.lang/PR27908.java b/libjava/testsuite/libjava.lang/PR27908.java index 09f96546f98..addb1d7720f 100644 --- a/libjava/testsuite/libjava.lang/PR27908.java +++ b/libjava/testsuite/libjava.lang/PR27908.java @@ -13,7 +13,8 @@ class PR27908 (t2 = new Thread (r2)).start(); (t3 = new Thread (r3)).start(); - Thread.yield(); + while (! (r1.isRunning() && r2.isRunning() && r3.isRunning())) + Thread.yield(); r1.stop(); r2.stop(); @@ -45,6 +46,11 @@ class PR27908 { running = false; } + + public boolean isRunning() + { + return running; + } } private static class run2 implements Runnable @@ -64,6 +70,11 @@ class PR27908 { running = false; } + + public boolean isRunning() + { + return running; + } } static class run3 implements Runnable @@ -83,5 +94,10 @@ class PR27908 { running = false; } + + public boolean isRunning() + { + return running; + } } } diff --git a/libjava/testsuite/libjava.lang/WalkerTest.jar b/libjava/testsuite/libjava.lang/WalkerTest.jar Binary files differnew file mode 100644 index 00000000000..64faf04df20 --- /dev/null +++ b/libjava/testsuite/libjava.lang/WalkerTest.jar diff --git a/libjava/testsuite/libjava.lang/WalkerTest.java b/libjava/testsuite/libjava.lang/WalkerTest.java new file mode 100644 index 00000000000..f4e41fecfa0 --- /dev/null +++ b/libjava/testsuite/libjava.lang/WalkerTest.java @@ -0,0 +1,15 @@ +class Foo +{ + Class bar() + { + return gnu.classpath.VMStackWalker.getCallingClass(); + } +} + +public class WalkerTest +{ + public static void main(String[] argv) + { + System.out.println(new Foo().bar()); + } +} diff --git a/libjava/testsuite/libjava.lang/WalkerTest.out b/libjava/testsuite/libjava.lang/WalkerTest.out new file mode 100644 index 00000000000..9b8eb003024 --- /dev/null +++ b/libjava/testsuite/libjava.lang/WalkerTest.out @@ -0,0 +1 @@ +class WalkerTest |