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 statements to release locks. #2962

Merged
merged 1 commit into from
Feb 1, 2019
Merged

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Feb 1, 2019

I noticed there were some instances of locking in conn/pool.go that were
not using the "defer l.Unlock()" pattern so I changed them to use it for
consistency with the rest of the codebase. There was an instance where
the lock is acquired and released inside a for-loop so I didn't change
that one.


This change is Reviewable

I noticed there were some instances of locking in conn/pool.go that were
not using the "defer l.Unlock()" pattern so I changed them to use it for
consistency with the rest of the codebase. There was an instance where
the lock is acquired and released inside a for-loop so I didn't change
that one.
@martinmr martinmr requested a review from a team February 1, 2019 01:59
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@martinmr martinmr merged commit b67493e into master Feb 1, 2019
@martinmr martinmr deleted the martinmr/lock-defer branch February 1, 2019 02:37
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
I noticed there were some instances of locking in conn/pool.go that were
not using the "defer l.Unlock()" pattern so I changed them to use it for
consistency with the rest of the codebase. There was an instance where
the lock is acquired and released inside a for-loop so I didn't change
that one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants