mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8249217: Unexpected StackOverflowError in "process reaper" thread still happens
Reviewed-by: martin, plevart, dholmes
This commit is contained in:
parent
e6875c9bac
commit
a0149f53f1
2 changed files with 9 additions and 5 deletions
|
@ -36,6 +36,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
@ -83,6 +84,9 @@ final class ProcessHandleImpl implements ProcessHandle {
|
|||
*/
|
||||
private static final Executor processReaperExecutor =
|
||||
doPrivileged((PrivilegedAction<Executor>) () -> {
|
||||
// Initialize ThreadLocalRandom now to avoid using the smaller stack
|
||||
// of the processReaper threads.
|
||||
ThreadLocalRandom.current();
|
||||
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
while (tg.getParent() != null) tg = tg.getParent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue