TaskCompletionSource.SetFromTask(Task) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Transitions the underlying Task<TResult> into the same completion state as the specified completedTask
.
public:
void SetFromTask(System::Threading::Tasks::Task ^ completedTask);
public void SetFromTask (System.Threading.Tasks.Task completedTask);
member this.SetFromTask : System.Threading.Tasks.Task -> unit
Public Sub SetFromTask (completedTask As Task)
Parameters
- completedTask
- Task
The completed task whose completion status (including exception or cancellation information) should be copied to the underlying task.
Exceptions
completedTask
is null
.
completedTask
is not completed.
The underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
Remarks
This operation will return false
if the Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.