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

ooni.go: use 32 bit counter to signal interruption #120

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Conversation

bassosimone
Copy link
Contributor

Using a 64 bit counter has pitfalls. See Go documentation.

I don't want a refactoring or whatever to let these pitfalls
emerge in the future.

We just need one bit to signal we're done.

So use 32 bit, which shall be safe everywhere.

See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.

Proactively triggered by ooni/probe-engine#399.

Using a 64 bit counter has pitfalls. See Go documentation.

I don't want a refactoring or whatever to let these pitfalls
emerge in the future.

We just need one bit to signal we're done.

So use 32 bit, which shall be safe everywhere.

See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.

Proactively triggered by ooni/probe-engine#399.
@bassosimone bassosimone marked this pull request as ready for review March 18, 2020 11:32
@bassosimone bassosimone merged commit 1d3e7e1 into master Mar 18, 2020
@bassosimone bassosimone deleted the issue/399 branch March 18, 2020 11:32
ainghazal pushed a commit to ainghazal/probe-cli that referenced this pull request Mar 8, 2022
Using a 64 bit counter has pitfalls. See Go documentation.

I don't want a refactoring or whatever to let these pitfalls
emerge in the future.

We just need one bit to signal we're done.

So use 32 bit, which shall be safe everywhere.

See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.

Proactively triggered by ooni/probe-engine#399.
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.

1 participant