Skip to content

Match old layouts and feature selection for named mutexes for cross-TFM compatibility - #134541

Merged
jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:shared-mutex-layout
Sep 24, 2026
Merged

jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:shared-mutex-layout

Conversation

@jkoritzinsky

Copy link
Copy Markdown
Member

Fixes #134491 by using a uint64 for thread id and using non-pthread based mutexes for linux arm and linux arm64.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates named mutex shared-memory layouts and backend selection to preserve cross-TFM compatibility with older .NET versions.

Changes:

  • Widens owner thread IDs to 64 bits.
  • Aligns managed/native layouts with the legacy PAL format.
  • Uses file-lock mutexes on Linux ARM/ARM64.
File Description
src/​native/​libs/​System.Native/​pal_crossprocessmutex.h Updated as part of this pull request.
src/​native/​libs/​System.Native/​pal_crossprocessmutex.c Updated as part of this pull request.
src/​native/​libs/​System.Native/​pal_crossprocessmutex_unsupported.c Updated as part of this pull request.
src/​libraries/​System.Private.CoreLib/​src/​System/​Threading/​NamedMutex.Unix.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​Interop/​Unix/​System.Native/​Interop.LowLevelCrossProcessMutex.cs Updated as part of this pull request.

Comment thread src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs Outdated
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Copilot AI review requested due to automatic review settings September 24, 2026 02:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Resolve the compatibility and migration issues between old and new mutex layouts before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

@jkoritzinsky
jkoritzinsky merged commit 6a48f79 into dotnet:main Sep 24, 2026
163 of 166 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Sep 24, 2026
@jkoritzinsky

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET 11 breaks named Mutex interop with every earlier .NET on Linux and macOS

4 participants