Skip to content

Conversation

jkoritzinsky
Copy link
Member

Removes another usage of the CoreCLR Win32 PAL Mutex

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 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 replaces the CoreCLR Win32 PAL HANDLE–based logging mutex with the cross-platform minipal_mutex.

  • Changed the global LogFileMutex type from HANDLE to minipal_mutex*.
  • Updated EnterLogLock/LeaveLogLock to call minipal_mutex_enter/minipal_mutex_leave.
  • Modified InitializeLogging to new and initialize a minipal_mutex, using InterlockedCompareExchangeT to install it.
Comments suppressed due to low confidence (1)

src/coreclr/utilcode/log.cpp:184

  • [nitpick] The local variable name 'mutex' is very generic and could be confused with the global 'LogFileMutex'. Consider renaming it to 'newLogFileMutex' or similar for clarity.
    minipal_mutex* mutex = new minipal_mutex;

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
@jkoritzinsky jkoritzinsky enabled auto-merge (squash) July 16, 2025 01:45
@jkoritzinsky
Copy link
Member Author

/ba-g failures are unrelated

@jkoritzinsky jkoritzinsky merged commit b9fb863 into dotnet:main Jul 16, 2025
91 of 96 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 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