Skip to content

Remove eager initialization of _startupScripts to enable lazy thread-safe initialization #25767

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Jul 20, 2025

The field _startupScripts was being initialized at declaration, which prevented the
Interlocked.CompareExchange logic in the StartupScripts property from ever executing.

This change removes the eager initialization to allow proper lazy and thread-safe setup
of the HashSet when the property is first accessed.

…d-safe initialization

The field `_startupScripts` was being initialized at declaration, which prevented the
`Interlocked.CompareExchange` logic in the `StartupScripts` property from ever executing.
This change removes the eager initialization to allow proper lazy and thread-safe setup
of the HashSet when the property is first accessed.
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Jul 27, 2025
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze
Copy link
Contributor Author

@iSazonov Could you please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - Needed The PR is being reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant