private void First(Task <bool> task, InnerHandler sender) { if (sender.CheckDisposed()) { Dispose(sender.Source); } else { if (Volatile.Read(ref _winner) == null && Interlocked.CompareExchange(ref _winner, sender, null) == null) { if (task.IsCanceled) { _winTask.TrySetCanceled(); } else if (task.IsFaulted) { _winTask.TrySetException(ExceptionHelper.Extract(task.Exception)); } else { _winTask.SetResult(task.Result); } } } }