diff options
author | Andrew Haley <aph@gcc.gnu.org> | 2007-09-04 17:54:56 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2007-09-04 17:54:56 +0000 |
commit | 0854f1891d6f327f1a3625f3aaaab3c595377569 (patch) | |
tree | 8e1d1816291f3aaa4fb7975ed50aa7c29fe96e38 | |
parent | cb642590f317e30bd870b47934dac12a71f320b1 (diff) | |
download | gcc-0854f1891d6f327f1a3625f3aaaab3c595377569.zip gcc-0854f1891d6f327f1a3625f3aaaab3c595377569.tar.gz gcc-0854f1891d6f327f1a3625f3aaaab3c595377569.tar.bz2 |
re PR java/27908 (VMSecureRandom generateSeed infinite loop? (Regression))
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.
From-SVN: r128094
-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 0000000..b51c95f --- /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 e280407..1ec1127 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 09f9654..addb1d7 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 0000000..64faf04 --- /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 0000000..f4e41fe --- /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 0000000..9b8eb00 --- /dev/null +++ b/libjava/testsuite/libjava.lang/WalkerTest.out @@ -0,0 +1 @@ +class WalkerTest |