Skip to content
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

Use separate lock-object #1493

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Use separate lock-object #1493

merged 2 commits into from
Nov 15, 2023

Conversation

Thorium
Copy link
Member

@Thorium Thorium commented Nov 8, 2023

Trial to fix #1466: Do use separate lock-object instead of locking the array itself.

The PR uses the best practices of .NET, see: Jeff Richter book "CLR Via C#" chapter on locks.
Or e.g. https://stackoverflow.com/questions/1873201/why-are-locks-performed-on-separate-objects

@Thorium
Copy link
Member Author

Thorium commented Nov 9, 2023

The CI build is failing for "BuildFailedException: Target 'GenerateDocs' failed."
However that is a separate issue, not related to this PR.

Copy link
Collaborator

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks like the original code was the wrong way to do things, even if it doesn't resolve that issue. We should always be locking on a dedicated lock object. Thanks!

@cartermp cartermp merged commit 69dfe0e into fsprojects:main Nov 15, 2023
2 checks passed
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.

When closing VS 2022, the FSharp.Data.DesignTime stays on lock that prevents closing the editor.
2 participants