-
Notifications
You must be signed in to change notification settings - Fork 5k
Replace Win32 PAL implementation with minipal implementation #115858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Win32 PAL implementation with minipal implementation #115858
Conversation
Remove PALCEnterCriticalSection and PALCLeaveCriticalSection
Delete unused debugging APIs in PAL CS code
Get native AOT to build.
FWIW, I tested |
Remove any non-running tests requiring CRITICAL_SECTION Remove unused PAL header referencing CRITICAL_SECTION (internal.h)
It isn't just because of
clang on macOS doesn't support C11 threads. It isn't an option in any case. |
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_SECTION
on the Windows platform andpthread_mutex_t
on 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_SECTION
associated APIs and tests in the CoreCLR PAL have been removed.