-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add CompareAndSwap and Swap to String, Error, Value, Deprecate CAS #111
Conversation
Codecov Report
@@ Coverage Diff @@
## master #111 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 201 215 +14
=========================================
+ Hits 201 215 +14
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change largely looks good minus minor comments.
However, I'm concerned about introducing CAS methods for String, Error, and Value and at the same time deprecating them in favor of CompareAndSwap.
Could we possibly skip that step? No CAS methods for things that didn't already have one?
I guess that means merging the commits, then removing the new CAS methods. |
I could do this by introducing a This is the only way to do this cleanly, I think. @abhinav What do you think? Until feedback, I'll just update the PR to add the other commit that deprecates CAS. I can then implement the above later, after squashing all these commits. |
That sounds reasonable. The code generator is private so we can change its flags however we want. Thanks! |
…r of CompareAndSwap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making all the changes!
Thanks! |
Before opening your pull request, please make sure that you've:
make test
); and finally,make lint
).From #108 .
Add CompareAndSwap and Swap for String and Error. Deprecate CAS.
This is not done for Time since it is not meant to be compared.
I also have a commit bcb50e9, that deprecates CAS and adds CompareAndSwap to align with sync/atomic from go1.19. Since that commit depends on this one, I can only open a PR after this is merged.