Index: base/process/kill_win.cc |
diff --git a/base/process/kill_win.cc b/base/process/kill_win.cc |
index 99a7c661851c85d2fefb3d9046ffbf94e7f67852..cf099c9219057138444e197b97824e76a5738091 100644 |
--- a/base/process/kill_win.cc |
+++ b/base/process/kill_win.cc |
@@ -103,6 +103,18 @@ bool KillProcess(ProcessHandle process, int exit_code, bool wait) { |
return result; |
} |
+bool KillJob(HANDLE job, int exit_code, bool wait) { |
+ bool result = (TerminateJobObject(job, exit_code) != FALSE); |
+ if (result && wait) { |
+ // The processes may not end immediately due to pending I/O |
Paweł Hajdan Jr.
2014/04/23 10:49:22
nit: Please end all comments with a dot.
|
+ if (WAIT_OBJECT_0 != WaitForSingleObject(job, 60 * 1000)) |
+ DLOG_GETLASTERROR(ERROR) << "Error waiting for job exit"; |
Paweł Hajdan Jr.
2014/04/23 10:49:22
With this wait=true is effectively a no-op in case
|
+ } else if (!result) { |
+ DLOG_GETLASTERROR(ERROR) << "Unable to terminate job"; |
+ } |
+ return result; |
+} |
+ |
// Attempts to kill the process identified by the given process |
// entry structure, giving it the specified exit code. |
// Returns true if this is successful, false otherwise. |