Skip to content

Conversation

@JanKrivanek
Copy link
Member

Fixes #10260

Context

The BuildManager.Dispose was idempotent, but it wasn't very clear - needed code archeology, plus was easy to break.
Let's make it more clear.

Changes Made

Changed just 2 lines:

  • Consolidated disposing and _disposed check before lock (performing first the cheaper one on local parameter)
  • Added explicit short circuit check of _disposed after entering the lock

Rest of the displayed diff is caused by changed indention due to consolidating the 2 checks before locking.

@JanKrivanek JanKrivanek changed the title Short circuit double dispose Short circuit repetitive BuildManager.Dispose calls Sep 23, 2024
@JanKrivanek JanKrivanek enabled auto-merge (squash) September 26, 2024 11:13
@JanKrivanek JanKrivanek merged commit 2e87605 into main Oct 7, 2024
@JanKrivanek JanKrivanek deleted the proto/buildmgr-dispose branch October 7, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is the double-checked locking pattern in BuildManager correct?

4 participants