This is the implementation of the CancelTaskAsync interface in DownloadService.cs.
public async Task CancelTaskAsync()
{
CancelAsync();
await Task.Yield(); // prevents a sync/hot thread hangup
if (_taskCompletion is not null)
await _taskCompletion.Task;
}
The CancelAsync(); function does not call _taskCompletion.TrySetCanceled() or _taskCompletion.TrySetResult(e) on _taskCompletion, so await _taskCompletion.Task will hang indefinitely.
This is the implementation of the CancelTaskAsync interface in DownloadService.cs.
The
CancelAsync();
function does not call_taskCompletion.TrySetCanceled()
or_taskCompletion.TrySetResult(e)
on _taskCompletion, soawait _taskCompletion.Task
will hang indefinitely.