Fix for Concurrent Map Access in HashSet & LinkedHashSet #265

Open
lunuan wants to merge 2 commits from lunuan/master into master
lunuan commented 2024-09-21 07:39:46 +00:00 (Migrated from github.com)

Improved HashSet for concurrent map operations by integrating sync.RWMutex for thread-safe reads and writes. This change prevents potential data races and ensures consistent performance in multi-threaded environments.

Changes include:

  • Added sync.RWMutex for safe access.
  • Protected all read and write methods with appropriate locks.
  • Updated unit tests to cover concurrent scenarios.
Improved HashSet for concurrent map operations by integrating sync.RWMutex for thread-safe reads and writes. This change prevents potential data races and ensures consistent performance in multi-threaded environments. Changes include: - Added sync.RWMutex for safe access. - Protected all read and write methods with appropriate locks. - Updated unit tests to cover concurrent scenarios.
sonarqubecloud[bot] commented 2024-09-21 14:45:38 +00:00 (Migrated from github.com)
## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=gods&pullRequest=265) **Quality Gate passed** Issues ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=gods&pullRequest=265&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=gods&pullRequest=265&issueStatuses=ACCEPTED) Measures ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=gods&pullRequest=265&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=gods&pullRequest=265&metric=new_coverage&view=list) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [26.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=gods&pullRequest=265&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=gods&pullRequest=265)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin "lunuan/master:lunuan/master"
git switch "lunuan/master"

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch "master"
git merge --no-ff "lunuan/master"
git switch "lunuan/master"
git rebase "master"
git switch "master"
git merge --ff-only "lunuan/master"
git switch "lunuan/master"
git rebase "master"
git switch "master"
git merge --no-ff "lunuan/master"
git switch "master"
git merge --squash "lunuan/master"
git switch "master"
git merge --ff-only "lunuan/master"
git switch "master"
git merge "lunuan/master"
git push origin "master"
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
golibs/gms-gods!265
No description provided.