XGameRuntime: terminate cancels a delayed callback #198
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/198"
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?
Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-24T22:29:13Z.
XTaskQueueTerminatecancels 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: cleanImported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T03:37:48Z.
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