mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-25 04:47:53 +00:00
8000817: Reinstate accidentally removed sleep() from ProcessBuilder/Basic.java
Reviewed-by: alanb, martin
This commit is contained in:
parent
037bcf1683
commit
2dca3dc06b
@ -41,6 +41,7 @@ import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.security.*;
|
||||
import sun.misc.Unsafe;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
import static java.lang.System.getenv;
|
||||
@ -1960,6 +1961,7 @@ public class Basic {
|
||||
|
||||
thread.start();
|
||||
latch.await();
|
||||
Thread.sleep(10);
|
||||
|
||||
String os = System.getProperty("os.name");
|
||||
if (os.equalsIgnoreCase("Solaris") ||
|
||||
@ -1984,6 +1986,15 @@ public class Basic {
|
||||
while (useCountField.getInt(deferred) <= 0) {
|
||||
Thread.yield();
|
||||
}
|
||||
} else if (s instanceof BufferedInputStream) {
|
||||
Field f = Unsafe.class.getDeclaredField("theUnsafe");
|
||||
f.setAccessible(true);
|
||||
Unsafe unsafe = (Unsafe)f.get(null);
|
||||
|
||||
while (unsafe.tryMonitorEnter(s)) {
|
||||
unsafe.monitorExit(s);
|
||||
Thread.sleep(1);
|
||||
}
|
||||
}
|
||||
p.destroy();
|
||||
thread.join();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user