TaskCompletionSource.TrySetFromTask(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.
Attempts to transition the underlying Task<TResult> into the same completion state as the specified completedTask
.
public:
bool TrySetFromTask(System::Threading::Tasks::Task ^ completedTask);
public bool TrySetFromTask (System.Threading.Tasks.Task completedTask);
member this.TrySetFromTask : System.Threading.Tasks.Task -> bool
Public Function TrySetFromTask (completedTask As Task) As Boolean
Parameters
- completedTask
- Task
The completed task whose completion status (including exception or cancellation information) should be copied to the underlying task.
Returns
true
if the operation was successful; otherwise, false
.
Exceptions
completedTask
is null
.
completedTask
is not completed.
Remarks
This operation will return false
if the Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
Applies to
Athugasemdir
https://aka.ms/ContentUserFeedback.
Væntanlegt: Á árinu 2024 munum við hætta með GitHub-mál sem ábendingaleið fyrir efni og skipta því út fyrir nýtt ábendingakerfi. Frekari upplýsingar er að finna hér:Senda inn og skoða endurgjöf fyrir