diff options
author | Zoltan Varga <vargaz@gmail.com> | 2017-03-30 04:42:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-30 04:42:01 +0300 |
commit | dd08fd4160ee549fc529bd1e819ffd3c54f62cd8 (patch) | |
tree | ecbdf12676a8c1a242bf0b3a9f85b80b4422358a /mcs/class/referencesource | |
parent | bcefc710782c9e95d3e9bcad58d4bcf1a944150d (diff) |
[bcl] Avoid waiting for events inside a finalizer in Process.WaitForExit () because it can hang if the thread which sets the event is aborted during shutdown. Fixes #53843. (#4609) (#4617)
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r-- | mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs index 2a5432d0ace..4fc2f7c2078 100644 --- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs +++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs @@ -2569,11 +2569,6 @@ namespace System.Diagnostics { signaled = false; } } - } - finally { - if( processWaitHandle != null) { - processWaitHandle.Close(); - } // If we have a hard timeout, we cannot wait for the streams if( output != null && milliseconds == -1) { @@ -2583,6 +2578,11 @@ namespace System.Diagnostics { if( error != null && milliseconds == -1) { error.WaitUtilEOF(); } + } + finally { + if( processWaitHandle != null) { + processWaitHandle.Close(); + } ReleaseProcessHandle(handle); |