/// <inheritdoc /> public void Dispose() { if (Interlocked.CompareExchange(ref _disposed, 1, 0) != 0) { return; } _process.Exited -= OnProcessExit; _exitTaskCompletionSource.TrySetResult(null); _process.Dispose(); _logOperation.NotifyDisposed(); }
/// <inheritdoc /> public void Dispose() { lock (_syncRoot) { if (_disposed) { return; } _disposed = true; } _process.Exited -= OnProcessExit; _exitTaskCompletionSource.TrySetCanceled(); _process.Dispose(); _logOperation.NotifyDisposed(); }