Skip to content

Move MethodContextReader to use the minipal mutex #117685

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

jkoritzinsky
Copy link
Member

Removes one of the few remaining usages of the Win32 PAL Mutex in native code.

@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 21:24
@jkoritzinsky jkoritzinsky added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 15, 2025
Copy link
Contributor

@Copilot 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 modernizes synchronization in the SuperPMI tool by replacing Win32 PAL mutex usage with the minipal mutex implementation. This change removes one of the remaining dependencies on Win32 PAL mutex in native code, likely improving portability and consistency with the broader runtime codebase.

Key changes:

  • Replace Win32 HANDLE-based mutex with minipal_mutex type
  • Update mutex initialization, destruction, and locking operations to use minipal APIs
  • Simplify the AcquireLock method by removing error handling since minipal_mutex_enter doesn't fail

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
methodcontextreader.h Updates mutex member variable type and adds minipal/mutex.h include
methodcontextreader.cpp Replaces Win32 mutex APIs with minipal equivalents in constructor, destructor, and lock methods

Copy link
Contributor

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

@jkoritzinsky
Copy link
Member Author

/ba-g failures unrelated

@jkoritzinsky jkoritzinsky disabled auto-merge July 16, 2025 19:02
@jkoritzinsky jkoritzinsky enabled auto-merge (squash) July 16, 2025 19:02
@jkoritzinsky jkoritzinsky merged commit 885879e into dotnet:main Jul 16, 2025
93 of 96 checks passed
@jkoritzinsky jkoritzinsky deleted the mcr-minipal branch July 16, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants