-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
sync/atomic: explain how to add -1 using AddUint32 #6408
Labels
Milestone
Comments
I will add some examples to the package to show how Sub can be implemented. Labels changed: added priority-later, go1.2maybe, documentation, removed priority-triage. Owner changed to @davecheney. Status changed to Accepted. |
SubUint32(addr, x) is AddUint32(addr, -x). This part isn't even worth a comment. The only time this is awkward is when x is a constant and you're using an unsigned type. I think that's a more general issue with constants, although not one I have a solution to. The easiest fix is to use a signed count. |
This issue was closed by revision c457963. Status changed to Fixed. |
Issue #6711 has been merged into this issue. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by runner.mei:
The text was updated successfully, but these errors were encountered: