De-duplicate PreAllocatedOverlapped non-Windows stubs; remove stale ILLink workaround#125507
Draft
De-duplicate PreAllocatedOverlapped non-Windows stubs; remove stale ILLink workaround#125507
Conversation
…pped.Unix.cs, remove ILLink workaround Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jkotas
March 12, 2026 18:48
View session
Contributor
|
Tagging subscribers to this area: @agocke, @VSadov |
This was referenced Mar 13, 2026
Open
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.
PreAllocatedOverlappedhad two separate implementations for non-Windows platforms: a full portable implementation (Unix.cs) for Unix and Browser with managed threads, and a no-op stub (Browser.cs) for Browser/Wasi without managed threads — despite overlapped I/O being unsupported (ThreadPoolBoundHandle.BindHandlealways throwsPlatformNotSupportedException) on all non-Windows targets.Changes
PreAllocatedOverlapped.Browser.cs— the no-op stub is replaced by the existing portable implementation.PreAllocatedOverlapped.Unix.cs+Portable.csto all non-Windows platforms — moved outside theFeaturePortableThreadPoolItemGroup into a newTargetsWindows != truegroup, so they compile for Browser/Wasi regardless ofFeaturePortableThreadPool.Portable.csin theFeaturePortableThreadPoolgroup for Windows — required for the portable thread pool code path on Windows.ThreadPoolBoundHandleOverlapped.csto the Browser/Wasi-without-managed-threads group —Portable.csdepends on it; previously it was only compiled underFeaturePortableThreadPool.ThreadPoolBoundHandleILLink descriptor — the workaround (preserving.interfaceimplwhen the type is not instantiated on Unix) was fixed in the linker long ago (mono/linker#649).Behavioral note: On Browser/Wasi without managed threads,
PreAllocatedOverlappedconstructor now validatescallbackis non-null and allocates aThreadPoolBoundHandleOverlapped(matching Unix behavior), instead of being a complete no-op. This is intentional and harmless sinceBindHandlestill throws, making the object unusable.