/// <summary> /// Ends the await on the completed <see cref="T:Theraot.Core.System.Threading.Tasks.Task`1"/>. /// </summary> /// /// <returns> /// The result of the completed <see cref="T:Theraot.Core.System.Threading.Tasks.Task`1"/>. /// </returns> /// <exception cref="T:System.NullReferenceException">The awaiter was not properly initialized.</exception><exception cref="T:System.InvalidOperationException">The task was not yet completed.</exception><exception cref="T:Theraot.Core.System.Threading.Tasks.TaskCanceledException">The task was canceled.</exception><exception cref="T:System.Exception">The task completed in a Faulted state.</exception> public TResult GetResult() { TaskAwaiter.ValidateEnd(_task); return(_task.Result); }
/// <summary> /// Schedules the continuation onto the <see cref="T:Theraot.Core.System.Threading.Tasks.Task"/> associated with this <see cref="T:Theraot.Core.System.Runtime.CompilerServices.TaskAwaiter"/>. /// </summary> /// <param name="continuation">The action to invoke when the await operation completes.</param><exception cref="T:System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception><exception cref="T:System.NullReferenceException">The awaiter was not properly initialized.</exception> /// <remarks> /// This method is intended for compiler user rather than use directly in code. /// </remarks> public void OnCompleted(Action continuation) { TaskAwaiter.OnCompletedInternal(_task, continuation, _continueOnCapturedContext); }
public void UnsafeOnCompleted(Action continuation) { TaskAwaiter.OnCompletedInternal(_task, continuation, true); }