Repository navigation
Task queues: a terminated queue takes no new work - #57
Merged
Merged
Conversation
XTaskQueueSubmitCallback, XTaskQueueSubmitDelayedCallback and XTaskQueueRegisterWaiter accepted work on a terminated queue. Such work ran canceled, and a delayed callback ran after the termination callback had already told the title the queue was done. They now return E_ABORT, as libHttpClient's VerifyNotTerminated does. E_ABORT_QUEUE_TERMINATED (unused, and not E_ABORT's value) is removed.
ivall
added a commit
that referenced
this pull request
Nov 23, 2026
Like XTaskQueueSubmitDelayedCallback since #57 (libHttpClient schedules through it): E_ABORT, so XAsyncRun / XCL's own operations on a terminated queue fail through the block (#56) and their work never runs. Test async_work_on_a_terminated_queue_is_aborted; the task queue module comment follows #54 / #57.
Collaborator
|
Merged (eb8ed07). Extended to Tested on Windows 11 (RX 9070): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.