public void Started(int exitCode) { lock (_startedLock) { if (_started) { return; } _started = true; } StartedPrivate?.Invoke(exitCode); }
public async Task StartedAsync(int startedCode, CancellationToken cancellationToken = default) { lock (_startedLock) { if (_started) { return; } _started = true; _startedCode = startedCode; _startedCancelationToken = cancellationToken; } await StartedPrivate.Invoke(startedCode, cancellationToken); }