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

No lock on Counter.dec() #69

Open
orzechow opened this issue Mar 18, 2019 · 3 comments
Open

No lock on Counter.dec() #69

orzechow opened this issue Mar 18, 2019 · 3 comments

Comments

@orzechow
Copy link

It seems like you forgot to lock the Counter on dec():

def dec(self, val=1):

@omergertel
Copy link
Owner

Feel free to open a pull request 🤓

@orzechow
Copy link
Author

Well I just had a look at your code (when researching for a usage metrics library), but didn't check it out or sth. (still didn't decide on a library).

@MasonEgger
Copy link

Since dec() calls inc() which does the lock, I don't think a lock is necessary in dec() This would result in deadlock since the dec() function would hold the lock, then inc() would try to attain it and would be unable to.

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

No branches or pull requests

3 participants