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
This commit is contained in:
parent
cb642590f3
commit
0854f1891d
BIN
libjava/testsuite/libjava.lang/Foo.class
Normal file
BIN
libjava/testsuite/libjava.lang/Foo.class
Normal file
Binary file not shown.
Binary file not shown.
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
libjava/testsuite/libjava.lang/WalkerTest.jar
Normal file
BIN
libjava/testsuite/libjava.lang/WalkerTest.jar
Normal file
Binary file not shown.
15
libjava/testsuite/libjava.lang/WalkerTest.java
Normal file
15
libjava/testsuite/libjava.lang/WalkerTest.java
Normal file
@ -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());
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.lang/WalkerTest.out
Normal file
1
libjava/testsuite/libjava.lang/WalkerTest.out
Normal file
@ -0,0 +1 @@
|
||||
class WalkerTest
|
Loading…
x
Reference in New Issue
Block a user