XGameRuntime: terminate cancels a delayed callback #198
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!198
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/198/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@davutsimsekk on GitHub · 2026-11-24 22:29 UTC · original
davutsimsekk:fix/taskqueue-terminate-delayed→main· +35 −0 · 1 files · 1 commits · closed without mergingXTaskQueueTerminatecancels callbacks already in a port's queue, but a callback still parked on its delay is invisible: it is on a sleeper thread and only reaches the port when the sleep ends. After termination it was delivered and run withcanceled = false, and a laterXTaskQueueDispatchreturned work on a terminated queue.The GDK contract is that termination invokes every pending callback with
canceled = true, and dispatch returns false once the queue is terminated.This makes
Queue::delivercancel the task when the queue is terminated instead of submitting it late. Normal delivery and termination of already-queued tasks are unchanged.Test
terminate_cancels_a_callback_still_on_its_delaycreates a manual queue, submits a 100 ms delayed callback, terminates, waits past the delay, then asserts dispatch is false and the callback sawcanceled = true. Onmainthe callback runs withcanceled = falseand dispatch returns true.cargo test -p victory-hle --lib: 96 passed, 0 failedcargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean@davutsimsekk on GitHub · 2026-11-25 03:37 UTC · original
Superseded by #584, which cancels delayed timers and scopes composite queue termination. Closing this narrow version to keep one fix per area.
Pull request closed