Replace Win32 PAL implementation with minipal implementation#115858
Merged
AaronRobinsonMSFT merged 42 commits intodotnet:mainfrom May 29, 2025
Merged
Replace Win32 PAL implementation with minipal implementation#115858AaronRobinsonMSFT merged 42 commits intodotnet:mainfrom
AaronRobinsonMSFT merged 42 commits intodotnet:mainfrom
Conversation
Remove PALCEnterCriticalSection and PALCLeaveCriticalSection
Delete unused debugging APIs in PAL CS code
Get native AOT to build.
Member
|
FWIW, I tested |
huoyaoyuan
reviewed
May 22, 2025
Remove any non-running tests requiring CRITICAL_SECTION Remove unused PAL header referencing CRITICAL_SECTION (internal.h)
Member
Author
It isn't just because of
clang on macOS doesn't support C11 threads. It isn't an option in any case. |
jkotas
reviewed
May 23, 2025
This was referenced May 24, 2025
jkotas
reviewed
May 28, 2025
jkotas
reviewed
May 28, 2025
jkotas
approved these changes
May 28, 2025
This was referenced May 29, 2025
Merged
Member
|
Related: #47700 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR removes the PAL Win32 emulation of
CRITICAL_SECTION. The emulation logic is unnecessarily complicated and used both a pthread mutex and condition variable. For CoreCLR purposes a mutex is sufficient.A new minipal API was introduced,
minipal_critsect. This uses the Win32CRITICAL_SECTIONon the Windows platform andpthread_mutex_ton all other platforms. This implementation aligns with a private "critical section" defined for the GC and native AOT. All now use this new API.The
CRITICAL_SECTIONassociated APIs and tests in the CoreCLR PAL have been removed.