fix: WaitForTaskYield getting stuck
This commit is contained in:
@@ -15,15 +15,15 @@ public class WaitForTaskYield(Task task, TaskCompletionStatus completionStatus =
|
|||||||
throw new("Task has been canceled.");
|
throw new("Task has been canceled.");
|
||||||
if (task.IsFaulted)
|
if (task.IsFaulted)
|
||||||
throw task.Exception ?? new("Task has faulted.");
|
throw task.Exception ?? new("Task has faulted.");
|
||||||
return task.IsCompletedSuccessfully;
|
return !task.IsCompletedSuccessfully;
|
||||||
|
|
||||||
case TaskCompletionStatus.Failed:
|
case TaskCompletionStatus.Failed:
|
||||||
if (task.IsCompletedSuccessfully)
|
if (task.IsCompletedSuccessfully)
|
||||||
throw new("Task was completed successfully.");
|
throw new("Task was completed successfully.");
|
||||||
return task.IsFaulted;
|
return !task.IsFaulted;
|
||||||
}
|
}
|
||||||
|
|
||||||
return task.IsCompleted;
|
return !task.IsCompleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TaskCompletionStatus
|
public enum TaskCompletionStatus
|
||||||
|
|||||||
Reference in New Issue
Block a user