Skip to content

Conversation

@jkoritzinsky
Copy link
Member

For the no-pthreads shared memory implementation, we can dispose an unnamed Mutex object when disposing a named Mutex.

When we dispose a named Mutex, we'll acquire the shared memory process-level lock to do so. Then when we dispose the unnamed mutex, we'll acquire the Wait Subsystem lock to be able to handle cleanup. When we lock a named mutex, currently we acquire the process-level lock for the shared memory manager while we still hold the wait subsystem lock (inverse order of lock aquisition -> deadlock). This is not necessary (we aren't going to touch any of the WaitSubsystem data structures at this point) so reorder the locks so we don't lock the wait subsystem lock when acquiring the shared memory lock.

Unblocks dotnet/aspnetcore#65006

…rocess-level lock

For the no-pthreads shared memory implementation, we can dispose an unnamed Mutex object when disposing a named Mutex.

When we dispose a named Mutex, we'll acquire the shared memory process-level lock to do so. Then when we dispose the unnamed mutex, we'll acquire the Wait Subsystem lock to be able to handle cleanup.
When we lock a named mutex, currently we acquire the process-level lock for the shared memory manager while we still hold the wait subsystem lock (inverse order of lock aquisition -> deadlock). This is not necessary (we aren't going to touch any of the WaitSubsystem data structures at this point) so reorder the locks so we don't lock the wait subsystem lock when acquiring the shared memory lock.
@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 Jan 14, 2026
@jkoritzinsky jkoritzinsky 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 Jan 14, 2026
@dotnet-policy-service
Copy link
Contributor

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

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) January 14, 2026 03:44
@jkoritzinsky jkoritzinsky merged commit 9190f38 into dotnet:main Jan 14, 2026
151 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Jan 14, 2026
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.

2 participants