Add support for pause & resume of thread-bound items in coroutines#621
Open
jonwis wants to merge 7 commits intomicrosoft:masterfrom
Open
Add support for pause & resume of thread-bound items in coroutines#621jonwis wants to merge 7 commits intomicrosoft:masterfrom
jonwis wants to merge 7 commits intomicrosoft:masterfrom
Conversation
dunhor
reviewed
Feb 25, 2026
dunhor
reviewed
Feb 25, 2026
dunhor
reviewed
Feb 25, 2026
Member
Author
|
So I'm on these: Installed just today. I can undo the change to the cmake file - I can't reproduce it building from a vs x64 build window with the scripts or with manual "cmake --preset clang ; cmake --build --preset clang-debug" ... |
dunhor
reviewed
Feb 26, 2026
Comment on lines
+678
to
+687
| // Priority tags for SFINAE-based overload resolution | ||
| struct get_awaiter_priority_fallback | ||
| { | ||
| }; | ||
| struct get_awaiter_priority_free_op : get_awaiter_priority_fallback | ||
| { | ||
| }; | ||
| struct get_awaiter_priority_member_op : get_awaiter_priority_free_op | ||
| { | ||
| }; |
Member
There was a problem hiding this comment.
There's a wil::details::priority_tag<N> I added (moved) somewhat recently. May be better to just re-use it? Higher N gets higher priority.
Member
There was a problem hiding this comment.
Wait, oops, it's not in the details namespace
Member
Author
There was a problem hiding this comment.
@copilot please fix and use the standard priority_tag<> type instead
dunhor
reviewed
Feb 26, 2026
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.
We saw heap & stack corruptions with code like:
This type and types that use it are inherently thread-bound, and there's no guarantee that the continuation happens on the same thread.
Instead, this new helper lets you say:
... and the awaitable will unhook the watcher on the source thread during suspend and reattach it on the continuation thread before processing exception propagation, etc.