private void RunThread() { try { _threadFunction(); } finally { OnThreadFinished?.Invoke(this, new ThreadFinishedEventArgs(this)); } }
private void RunThread() { try { _threadFunction(); } finally { OnThreadFinished?.Invoke(this, new ThreadFinishedEventArgs(this)); _taskCompletionSource.SetResult(true); } }