Skip to content

Conversation

@jkoritzinsky
Copy link
Member

Will help with validating the behaviors in #117635

@jkoritzinsky jkoritzinsky requested review from Copilot and jkotas and removed request for Copilot August 13, 2025 23:48
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 13, 2025
@jkotas jkotas added area-System.Threading and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 14, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@Copilot Copilot AI review requested due to automatic review settings August 14, 2025 03:42
Copy link
Contributor

Copilot AI left a 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

@jkoritzinsky jkoritzinsky requested a review from jkotas August 14, 2025 18:14
Copy link
Member

@jkotas jkotas left a 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

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) August 14, 2025 21:26
@jkoritzinsky
Copy link
Member Author

/ba-g DNS on build agent failure

@jkoritzinsky jkoritzinsky merged commit 2a95831 into dotnet:main Aug 15, 2025
83 of 88 checks passed
@jkoritzinsky jkoritzinsky deleted the shared-mutex-tests branch August 15, 2025 17:36
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants