summaryrefslogtreecommitdiffstats
path: root/base/process_util.h
diff options
context:
space:
mode:
authorjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 08:31:51 +0000
committerjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 08:31:51 +0000
commitc7691de3400bc8d62d85c96d41323eee85b85d22 (patch)
treed7cf9983cb979c0d8638c0a03f7f79f06ef256f3 /base/process_util.h
parent6296948cd669293abfe7b516fd22b08041f8f4f5 (diff)
downloadchromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.zip
chromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.tar.gz
chromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.tar.bz2
Linux: inform the Zygote when it's waiting on a dead process
If the browser calls ProcessDied() and asks the Zygote to wait (without blocking) on a dead process, the kernel might not be done destroying it and the Zygote may mistakenly claim that the process is alive. We now inform the Zygote over the IPC that the process is already dead so that it can wait synchroneously. BUG=157458 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11316261 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r--base/process_util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h
index 2805e42..f2d374c 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -512,6 +512,15 @@ BASE_EXPORT bool KillProcessById(ProcessId process_id, int exit_code,
BASE_EXPORT TerminationStatus GetTerminationStatus(ProcessHandle handle,
int* exit_code);
+#if defined(OS_POSIX)
+// Wait for the process to exit and get the termination status. See
+// GetTerminationStatus for more information. On POSIX systems, we can't call
+// WaitForExitCode and then GetTerminationStatus as the child will be reaped
+// when WaitForExitCode return and this information will be lost.
+BASE_EXPORT TerminationStatus WaitForTerminationStatus(ProcessHandle handle,
+ int* exit_code);
+#endif // defined(OS_POSIX)
+
// Waits for process to exit. On POSIX systems, if the process hasn't been
// signaled then puts the exit code in |exit_code|; otherwise it's considered
// a failure. On Windows |exit_code| is always filled. Returns true on success,