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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user