|
|
@@ -1216,38 +1216,14 @@ namespace System.Diagnostics {
|
|
|
if (process_handle == IntPtr.Zero)
|
|
|
throw new InvalidOperationException ("No process is associated with this object.");
|
|
|
|
|
|
- DateTime start = DateTime.UtcNow;
|
|
|
-
|
|
|
if (!WaitForExit_internal (process_handle, ms))
|
|
|
return false;
|
|
|
|
|
|
- if (ms >= 0) {
|
|
|
- ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
|
|
|
- if (ms <= 0)
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (async_output != null && !async_output.IsCompleted) {
|
|
|
- if (false == async_output.AsyncWaitHandle.WaitOne (ms, false))
|
|
|
- return false; // Timed out
|
|
|
+ if (async_output != null && !async_output.IsCompleted)
|
|
|
+ async_output.AsyncWaitHandle.WaitOne ();
|
|
|
|
|
|
- if (ms >= 0) {
|
|
|
- ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
|
|
|
- if (ms <= 0)
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (async_error != null && !async_error.IsCompleted) {
|
|
|
- if (false == async_error.AsyncWaitHandle.WaitOne (ms, false))
|
|
|
- return false; // Timed out
|
|
|
-
|
|
|
- if (ms >= 0) {
|
|
|
- ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
|
|
|
- if (ms <= 0)
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (async_error != null && !async_error.IsCompleted)
|
|
|
+ async_error.AsyncWaitHandle.WaitOne ();
|
|
|
|
|
|
OnExited ();
|
|
|
|