[OrcJIT] distinguish normal and abrupt TaskDispatcher shutdown #154356
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.
Add a
run_to_complete
complement toshutdown
, which does nearly the same operations, but does not cancel future / pending work. The distinction is often mainly academic, but split for clarity of intent of each caller.Annotate each and every tests that assumes that any previously scheduled tasks have finished running with a call of
run_to_completion
before reading the variables written by those tasks. This more clearly emphasizes the expectations of each of these tests and makes them robust against data-races or changes to the default scheduler.These should have no impact currently, but have been tested and shown to pass with a scheduler which defers all work (as if being run on a thread) until an explicit synchronization point "acquires" that state, demonstrating that this is each and every test that would be affected by changes to the default scheduler.