Revert free-threaded assert in FreeThreadedStrategy#130981
Merged
Merged
Conversation
Update documentation for the DefaultIUnknownStrategy member. Add comment on FreeThreadedStrategy on use cases.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/interop-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the COM marshalling strategy docs and implementation by removing a DEBUG-only “free-threaded” (agility) assert from FreeThreadedStrategy and clarifying when StrategyBasedComWrappers.DefaultIUnknownStrategy is intended to be used.
Changes:
- Removed the DEBUG-only agility probe/assert from
FreeThreadedStrategy. - Added an explanatory class comment on
FreeThreadedStrategy. - Updated the XML remarks for
StrategyBasedComWrappers.DefaultIUnknownStrategyto broaden/clarify the intended use.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs | Updates the public remarks for the default IIUnknownStrategy. |
| src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/FreeThreadedStrategy.cs | Removes DEBUG-only agility assertion logic and adds clarifying commentary. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 3
lewing
approved these changes
Jul 17, 2026
jtschuster
approved these changes
Jul 17, 2026
jtschuster
left a comment
Member
There was a problem hiding this comment.
Did preview 7 snap between #130906 and this?
elinor-fung
approved these changes
Jul 17, 2026
Member
Author
It is possible. I'll track that down. |
AaronRobinsonMSFT
enabled auto-merge (squash)
July 17, 2026 18:47
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.
Reverts the DEBUG-only free-threaded assert added to
FreeThreadedStrategyin #130906. The assert was overly strict:FreeThreadedStrategyis also valid for apartment-affinitized COM objects when the current thread already has the correct apartment type, so the agility probe produced false assert failures.Also clarifies documentation on
StrategyBasedComWrappers.DefaultIUnknownStrategyand adds a class comment onFreeThreadedStrategydescribing these use cases.Closes #130961.
Note
This PR description was generated with assistance from GitHub Copilot.