-
Notifications
You must be signed in to change notification settings - Fork 12.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
Use u32 instead of i32 for futexes. #96040
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m-ou-se
added
the
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
label
Apr 14, 2022
This comment was marked as off-topic.
This comment was marked as off-topic.
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Apr 14, 2022
@bors r+ |
📌 Commit 7a35c0f has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 14, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Apr 14, 2022
Use u32 instead of i32 for futexes. This changes futexes from i32 to u32. The [Linux man page](https://man7.org/linux/man-pages/man2/futex.2.html) uses `uint32_t` for them, so I'm not sure why I used i32 for them. Maybe because I first used them for thread parkers, where I used -1, 0, and 1 as the states. (Wasm's `memory.atomic.wait32` does use `i32`, because wasm doesn't support `u32`.) It doesn't matter much, but using the unsigned type probably results in fewer surprises when shifting bits around or using comparison operators. r? `@Amanieu`
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Apr 15, 2022
Use u32 instead of i32 for futexes. This changes futexes from i32 to u32. The [Linux man page](https://man7.org/linux/man-pages/man2/futex.2.html) uses `uint32_t` for them, so I'm not sure why I used i32 for them. Maybe because I first used them for thread parkers, where I used -1, 0, and 1 as the states. (Wasm's `memory.atomic.wait32` does use `i32`, because wasm doesn't support `u32`.) It doesn't matter much, but using the unsigned type probably results in fewer surprises when shifting bits around or using comparison operators. r? ``@Amanieu``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 15, 2022
Rollup of 11 pull requests Successful merges: - rust-lang#94457 (Stabilize `derive_default_enum`) - rust-lang#94461 (Create (unstable) 2024 edition) - rust-lang#94849 (Check var scope if it exist) - rust-lang#95194 (remove find_use_placement) - rust-lang#95749 (only downgrade selection Error -> Ambiguous if type error is in predicate) - rust-lang#96026 (couple of clippy::complexity fixes) - rust-lang#96027 (remove function parameters only used in recursion) - rust-lang#96034 ([test] Add test cases of untested functions for BTreeSet ) - rust-lang#96040 (Use u32 instead of i32 for futexes.) - rust-lang#96062 (docs: Update tests chapter for Termination stabilization) - rust-lang#96065 (Refactor: Use `format-args-capture` and remove unnecessary nested blocks in rustc_typeck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes futexes from i32 to u32. The Linux man page uses
uint32_t
for them, so I'm not sure why I used i32 for them. Maybe because I first used them for thread parkers, where I used -1, 0, and 1 as the states.(Wasm's
memory.atomic.wait32
does usei32
, because wasm doesn't supportu32
.)It doesn't matter much, but using the unsigned type probably results in fewer surprises when shifting bits around or using comparison operators.
r? @Amanieu