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.");
if (task.IsFaulted)
throw task.Exception ?? new("Task has faulted.");
return task.IsCompletedSuccessfully;
return !task.IsCompletedSuccessfully;
case TaskCompletionStatus.Failed:
if (task.IsCompletedSuccessfully)
throw new("Task was completed successfully.");
return task.IsFaulted;
return !task.IsFaulted;
}
return task.IsCompleted;
return !task.IsCompleted;
}
public enum TaskCompletionStatus