fix: WaitForTaskYield getting stuck

This commit is contained in:
2026-04-06 17:07:00 +03:00
parent 497eedab72
commit 44ff916afe

View File

@@ -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