mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8177932: (process) java/lang/ProcessHandle/OnExitTest.java failed with "Process A should not be alive..."
Reviewed-by: stuefe, dholmes, fyuan
This commit is contained in:
parent
5e55e5e2ee
commit
a3b9c07ee4
2 changed files with 4 additions and 4 deletions
|
@ -151,9 +151,9 @@ final class ProcessHandleImpl implements ProcessHandle {
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
// ignore and retry
|
// ignore and retry
|
||||||
}
|
}
|
||||||
startTime = isAlive0(pid); // recheck if is alive
|
startTime = isAlive0(pid); // recheck if it is alive
|
||||||
if (origStart > 0 && startTime != origStart) {
|
if (startTime > 0 && origStart > 0 && startTime != origStart) {
|
||||||
// start time changed, pid is not the same process
|
// start time changed (and is not zero), pid is not the same process
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,7 +662,7 @@ pid_t unix_getParentPidAndTimings(JNIEnv *env, pid_t pid,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the pid before returning the info in case /proc/pid is racy
|
// Validate the pid before returning the info
|
||||||
if (kill(pid, 0) < 0) {
|
if (kill(pid, 0) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue