mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8284165: Add pid to process reaper thread name
Reviewed-by: rriggs
This commit is contained in:
parent
36b3bbc53d
commit
9561b5e041
3 changed files with 32 additions and 25 deletions
|
@ -140,6 +140,9 @@ final class ProcessHandleImpl implements ProcessHandle {
|
|||
processReaperExecutor.execute(new Runnable() {
|
||||
// Use inner class to avoid lambda stack overhead
|
||||
public void run() {
|
||||
String threadName = Thread.currentThread().getName();
|
||||
Thread.currentThread().setName("process reaper (pid " + pid + ")");
|
||||
try {
|
||||
int exitValue = waitForProcessExit0(pid, shouldReap);
|
||||
if (exitValue == NOT_A_CHILD) {
|
||||
// pid not alive or not a child of this process
|
||||
|
@ -167,6 +170,10 @@ final class ProcessHandleImpl implements ProcessHandle {
|
|||
newCompletion.complete(exitValue);
|
||||
// remove from cache afterwards
|
||||
completions.remove(pid, newCompletion);
|
||||
} finally {
|
||||
// Restore thread name
|
||||
Thread.currentThread().setName(threadName);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ProcessReaperCCL {
|
|||
|
||||
// Verify all "Process Reaper" threads have a null CCL
|
||||
for (Thread th : Thread.getAllStackTraces().keySet()) {
|
||||
if ("process reaper".equals(th.getName())) {
|
||||
if (th.getName().startsWith("process reaper")) {
|
||||
Assert.assertEquals(th.getContextClassLoader(), null, "CCL not null");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -440,7 +440,7 @@ public class Basic {
|
|||
if ("Finalizer".equals(name)
|
||||
&& info.getLockName().startsWith("java.lang.ref.ReferenceQueue$Lock"))
|
||||
continue;
|
||||
if ("process reaper".equals(name))
|
||||
if (name.startsWith("process reaper"))
|
||||
continue;
|
||||
if (name != null && name.startsWith("ForkJoinPool.commonPool-worker"))
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue