Exemple #1
0
 public void GetResult()
 {
     if (task.Status != TaskStatus.RanToCompletion)
     {
         throw TaskAwaiter.HandleUnexpectedTaskResult(task);
     }
 }
Exemple #2
0
 public void GetResult()
 {
     if (task.Status != TaskStatus.RanToCompletion)
     {
         ExceptionDispatchInfo.Capture(TaskAwaiter.HandleUnexpectedTaskResult(task)).Throw();
     }
 }
Exemple #3
0
        public TResult GetResult()
        {
            if (task.Status != TaskStatus.RanToCompletion)
            {
                throw TaskAwaiter.HandleUnexpectedTaskResult(task);
            }

            return(task.Result);
        }
Exemple #4
0
            public void GetResult()
            {
                if (!task.IsCompleted)
                {
                    task.WaitCore(Timeout.Infinite, CancellationToken.None, true);
                }

                if (task.Status != TaskStatus.RanToCompletion)
                {
                    ExceptionDispatchInfo.Capture(TaskAwaiter.HandleUnexpectedTaskResult(task)).Throw();
                }
            }