compat-common: leave async call pending on XAsyncCancel until provider completes it #369

Closed
github-bot wants to merge 1 commit from gh-pr/369/head into gh-pr/369/base
Owner

@⁠FilimonEnc on GitHub · 2026-11-24 16:45 UTC · original
FilimonEnc:feat/xtq-xasync-cancel-provider-completion → main · +0 −4 · 2 files · 1 commits · closed without merging

In compat-common::gdk::rt, cancel() immediately called complete(block, E_ABORT, 0), which could cause XAsyncOp::Cleanup to execute while DoWork is still running on a worker thread. In the GDK/xgameruntime reference model, XAsyncCancel signals XAsyncOp::Cancel to the provider and marks the request canceled, leaving the call pending until the provider itself completes or aborts it.

Removing the premature complete() call allows verify_cancellation, verify_cleanup_waits_for_work, and verify_cleanup_waits_for_work_distributed to pass cleanly against the conformance suite, resolving three conformance gaps noted in #211.

**@⁠FilimonEnc** on GitHub · 2026-11-24 16:45 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/369) `FilimonEnc:feat/xtq-xasync-cancel-provider-completion` → `main` · +0 −4 · 2 files · 1 commits · closed without merging In `compat-common::gdk::rt`, `cancel()` immediately called `complete(block, E_ABORT, 0)`, which could cause `XAsyncOp::Cleanup` to execute while `DoWork` is still running on a worker thread. In the GDK/xgameruntime reference model, `XAsyncCancel` signals `XAsyncOp::Cancel` to the provider and marks the request canceled, leaving the call pending until the provider itself completes or aborts it. Removing the premature `complete()` call allows `verify_cancellation`, `verify_cleanup_waits_for_work`, and `verify_cleanup_waits_for_work_distributed` to pass cleanly against the conformance suite, resolving three conformance gaps noted in #211.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:20:33 +00:00
github-bot closed this pull request 2026-11-26 06:20:33 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:51 UTC · original

Thanks. #321 (now applied) makes the same XAsyncCancel change and also covers DoWork after cancel and Cleanup ordering, checked against the PC runtime. Closing this one as superseded.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:51 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/369#issuecomment-7164398904) Thanks. #321 (now applied) makes the same XAsyncCancel change and also covers DoWork after cancel and Cleanup ordering, checked against the PC runtime. Closing this one as superseded.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.