Skip to content

Use a mutex when checking out and checking in connections#40

Merged
ianoxley merged 3 commits intomasterfrom
mutex
Mar 12, 2021
Merged

Use a mutex when checking out and checking in connections#40
ianoxley merged 3 commits intomasterfrom
mutex

Conversation

@ianoxley
Copy link
Contributor

Update Connector to use a mutex, and add #synchronize blocks around the #check_out and #check_in methods.

Create a mutex, and use `#synchronize` in the `#check_out` and
`#check_in` methods.
@ianoxley ianoxley added the enhancement New feature or request label Mar 11, 2021
@ianoxley ianoxley requested a review from rwadstein March 11, 2021 19:56
@ianoxley ianoxley self-assigned this Mar 11, 2021
rwadstein
rwadstein previously approved these changes Mar 11, 2021
Copy link
Member

@rwadstein rwadstein left a comment

Choose a reason for hiding this comment

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

looks good. This may be argued as a little over protective, but puts control of everything else outside of pop and push (which is supposed to be thread safe) within the bounds of a single thread until done.

Reduce cognitive complexity to fix the CI build.
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit c7983fe and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@ianoxley ianoxley merged commit 3eb56ab into master Mar 12, 2021
@ianoxley ianoxley deleted the mutex branch March 12, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants