Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

Description

There are a few places where we can improve locking code. Specifically:

  • Replace double-checked locking on singleton object instantiation with sync.Once
  • Replace double-checked locking on maps with a concurrent map
  • Ensure defer is used correctly to release mutex locks where still used

For the concurrent map, I evaluated both sync.Map and xsync.MapOf, and decided on the latter.

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to this PR

@mattjohnsonpint mattjohnsonpint requested a review from a team December 6, 2024 21:41
@mattjohnsonpint mattjohnsonpint marked this pull request as draft December 6, 2024 21:45
@mattjohnsonpint mattjohnsonpint marked this pull request as ready for review December 6, 2024 22:05
@mattjohnsonpint mattjohnsonpint marked this pull request as draft December 6, 2024 22:08
@mattjohnsonpint mattjohnsonpint force-pushed the mjp/hyp-2738-improve-locking-code branch from b76c8bb to 3931766 Compare December 7, 2024 01:20
@mattjohnsonpint mattjohnsonpint marked this pull request as ready for review December 7, 2024 01:30
@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) December 7, 2024 01:33
@mattjohnsonpint mattjohnsonpint merged commit 4a32e44 into main Dec 7, 2024
90 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-2738-improve-locking-code branch December 7, 2024 01:34
@mattjohnsonpint mattjohnsonpint restored the mjp/hyp-2738-improve-locking-code branch December 7, 2024 01:35
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-2738-improve-locking-code branch December 7, 2024 01:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants