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 atomic.Bool instead of int32 operations #2089

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Feb 13, 2023

Fixes: #2043

@marten-seemann
There are a bunch of uses of int32 and int64 as atomic counters with atomic.AddInt32 or atomic.AddInt64. We can replace those with atomic.Int32 and atomic.Int64. Should I change those too?

@sukunrt sukunrt changed the title use atomic.Bool instead of int32 operations go 1.19: use atomic.Bool instead of int32 operations Feb 13, 2023
@marten-seemann
Copy link
Contributor

There are a bunch of uses of int32 and int64 as atomic counters with atomic.AddInt32 or atomic.AddInt64. We can replace those with atomic.Int32 and atomic.Int64. Should I change those too?

That would be great! Thank you!

@marten-seemann marten-seemann changed the title go 1.19: use atomic.Bool instead of int32 operations use atomic.Bool instead of int32 operations Feb 13, 2023
@marten-seemann marten-seemann merged commit ee07b39 into libp2p:master Feb 13, 2023
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

Successfully merging this pull request may close these issues.

Go 1.19: use atomic.Bool
2 participants