Skip to content

Remove a couple unnecessary 'lock(this)' statements#115013

Merged
ericstj merged 1 commit into
dotnet:mainfrom
steveharter:PerfCounterLock
Apr 29, 2025
Merged

Remove a couple unnecessary 'lock(this)' statements#115013
ericstj merged 1 commit into
dotnet:mainfrom
steveharter:PerfCounterLock

Conversation

@steveharter

Copy link
Copy Markdown
Contributor

These locks were ported from .NET Framework which did a security check within each lock, but those checks weren't ported over so the lock doesn't do anything special anymore.

Found by CodeQL.

@steveharter steveharter added this to the 10.0.0 milestone Apr 24, 2025
@steveharter steveharter requested a review from ericstj April 24, 2025 18:50
@steveharter steveharter self-assigned this Apr 24, 2025
Copilot AI review requested due to automatic review settings April 24, 2025 18:50

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.

Pull Request Overview

This PR removes unnecessary lock(this) statements in the CategoryName and MachineName property setters to eliminate redundant synchronization that no longer provides additional security checks.

  • Removed lock blocks in property setters
  • Cleaned up related comments

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter
See info in area-owners.md if you want to be subscribed.

@ericstj

ericstj commented Apr 29, 2025

Copy link
Copy Markdown
Member

/ba-g filed an issue for the 1 failure that was not known, but other known failures from this few-day old build have been fixed and are now appearing not known since BA doesn't consider build date / issue close date when evaluating known issues.

@ericstj ericstj merged commit ebe1414 into dotnet:main Apr 29, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 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.

4 participants