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:
Andrew Haley 2007-09-04 17:54:56 +00:00
parent cb642590f3
commit 0854f1891d
6 changed files with 33 additions and 1 deletions

Binary file not shown.

View File

@ -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;
}
}
}

Binary file not shown.

View 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());
}
}

View File

@ -0,0 +1 @@
class WalkerTest