-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add some tests for shared mutex corner cases #118710
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
Conversation
|
Tagging subscribers to this area: @mangod9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds test coverage for shared mutex corner cases on Unix platforms to validate behaviors related to named mutex implementation. The changes include adding a new native interop function to get system page size and implementing several test cases that validate error handling for invalid shared memory files.
Key changes:
- Added native
SystemNative_GetPageSize()function to retrieve system page size - Created managed interop wrapper for accessing page size from C#
- Added comprehensive test cases for named mutex error scenarios on Unix
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/native/libs/System.Native/pal_process.h |
Added declaration for SystemNative_GetPageSize function |
src/native/libs/System.Native/pal_process.c |
Implemented SystemNative_GetPageSize using getpagesize() |
src/native/libs/System.Native/entrypoints.c |
Registered the new function in the DLL import table |
src/libraries/System.Threading/tests/System.Threading.Tests.csproj |
Added reference to the new interop file for page size functionality |
src/libraries/Common/src/Interop/Unix/Interop.GetPageSize.cs |
Created managed wrapper with lazy initialization for page size access |
src/libraries/System.Threading/tests/MutexTests.cs |
Added test cases for invalid mutex names and corrupted shared memory scenarios |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the build breaks are fixed
|
/ba-g DNS on build agent failure |
Will help with validating the behaviors in #117635