-
Notifications
You must be signed in to change notification settings - Fork 258
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
AtomicUsize
has an unsound Sync
impl
#534
Comments
I believe this was added to support embedded system which don't support atomics (or threads). I don't even think it's possible to support threads without some of atomics, but I could be wrong here. |
While embedded systems may not have threads, many of them still have interrupts. It is possible to start writing to an |
This is documented in |
I see, I missed that. In that case it should be sound since it is only used when safety can be enforced. |
Since The potential for UB here is a similar setup where you start writing with |
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.24 to 4.0.25. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.0.24...v4.0.25) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The comment on the
Sync
impl forAtomicUsize
is:While this may be true in practice, it's still technically incorrect and could open the door for bad codegen. Is there some background on why this impl is required even for platforms that don't support atomics?
The text was updated successfully, but these errors were encountered: