Task queues: a terminated queue takes no new work #56
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/57"
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 ivall/xcl. Originally posted by gefydev on 2026-11-22T23:03:10Z.
XTaskQueueSubmitCallback,XTaskQueueSubmitDelayedCallbackandXTaskQueueRegisterWaiteraccept work on a queue afterXTaskQueueTerminate. That work then runs canceled, and a delayed callback runs after the termination callback has already told the title that the queue is done: a title that frees its context there gets a callback on freed memory. This happens, for example, with a callback that reschedules itself from its own canceled invocation during termination.libHttpClient rejects new work on a terminating or terminated port with
E_ABORT(TaskQueuePortImpl::VerifyNotTerminated, called fromQueueItemandRegisterWaitHandle). The three functions now do the same.E_ABORT_QUEUE_TERMINATEDis removed: it was unused, and its value (0x80040001) is notE_ABORT(0x80004004).Complements #54 (delayed callbacks already pending when the queue terminates); no conflicts between the two.
Validation
a_terminated_queue_takes_no_new_work. Onmainthe first submit afterTerminatereturnsS_OKinstead ofE_ABORT.cargo test -p xcl --lib: 344 passed, 0 failed, on Windows GNU under Wine.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T09:45:16Z.
Merged (
eb8ed07). Extended toXAsyncScheduleine38cb65(it submitted through the internalsubmit_delayed, past the new check).Tested on Windows 11 (RX 9070):
cargo test --workspacegreen (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!