public void GetResult() { if (task.Status != TaskStatus.RanToCompletion) { throw TaskAwaiter.HandleUnexpectedTaskResult(task); } }
public void GetResult() { if (task.Status != TaskStatus.RanToCompletion) { ExceptionDispatchInfo.Capture(TaskAwaiter.HandleUnexpectedTaskResult(task)).Throw(); } }
public TResult GetResult() { if (task.Status != TaskStatus.RanToCompletion) { throw TaskAwaiter.HandleUnexpectedTaskResult(task); } return(task.Result); }
public void GetResult() { if (!task.IsCompleted) { task.WaitCore(Timeout.Infinite, CancellationToken.None, true); } if (task.Status != TaskStatus.RanToCompletion) { ExceptionDispatchInfo.Capture(TaskAwaiter.HandleUnexpectedTaskResult(task)).Throw(); } }