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 defer to unlock mutex #66

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Conversation

vlasashk
Copy link
Contributor

@vlasashk vlasashk commented Aug 28, 2024

This PR:

  • fixes deadlock bug: GetOrSet deadlock #65 in GetOrSet method by unlocking mutex via defer call
  • use defer to unlock mutex in all other methods

@vlasashk vlasashk marked this pull request as draft August 28, 2024 12:07
@vlasashk vlasashk marked this pull request as ready for review August 28, 2024 12:07
@erni27
Copy link
Owner

erni27 commented Aug 28, 2024

Thanks! Do you mind doing the same for other methods? This doesn't seem like a big change so should perfectly fit into this PR.

@vlasashk
Copy link
Contributor Author

sure

@vlasashk vlasashk force-pushed the fix/deadlock-getorset branch from 1c4ea08 to ef6a2c6 Compare August 28, 2024 19:14
@vlasashk vlasashk force-pushed the fix/deadlock-getorset branch from ef6a2c6 to 33e6f3e Compare August 28, 2024 19:15
@erni27 erni27 changed the title FIX: deadlock fix - mutex unlock via defer in GetOrSet Use defer to unlock mutex Aug 29, 2024
Copy link
Owner

@erni27 erni27 left a comment

Choose a reason for hiding this comment

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

Thanks for both reporting the issue and fixing it!

@erni27 erni27 merged commit 0991f9b into erni27:master Aug 29, 2024
2 checks passed
@erni27 erni27 mentioned this pull request Aug 29, 2024
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.

2 participants