| Age | Commit message (Collapse) | Author | Lines |
|
atomic: remove 'Atomic*' from Debug output
For the same reason that we don't show `Vec { data: [0, 1, 2, 3] }`, but just the array, the `AtomicUsize(1000)` is noisy, and seeing just `1000` is likely better.
|
|
stabilize fetch_nand
This closes #13226 and makes `Atomic*.fetch_nand` stable.
|
|
|
|
|
|
Add a generic CAS loop to std::sync::Atomic*
This adds two new methods to both `AtomicIsize` and `AtomicUsize` with optimized safe compare-and-set loops, so users will no longer need to write their own, except in *very* strange circumstances.
`update_and_fetch` will apply the function and return its result, whereas `fetch_and_update` will apply the function and return the previous value.
This solves #48384 with `x.update_and_fetch(|x| x.max(y))`. It also relates to #48655 (which I misuse as tracking issue for now)..
*note* This *might* need a crater run because the functions could clash with third party extension traits.
|
|
This adds a new method to all numeric `Atomic*` types with a
safe compare-and-set loop, so users will no longer need to write
their own, except in *very* strange circumstances.
This solves #48384 with `x.fetch_max(_)`/`x.fetch_min(_)`. It
also relates to #48655 (which I misuse as tracking issue for now).
*note* This *might* need a crater run because the functions could
clash with third party extension traits.
|
|
Clarify AcqRel's docs
This implied things that are not true.
Fixes #49127
|
|
|
|
|
|
This implied things that are not true.
Fixes #49127
|
|
|
|
|
|
|
|
cc #13226 (the tracking issue)
|
|
Make UnsafeCell::into_inner safe
This fixes #35067. It will require a Crater run as discussed in that
issue.
|
|
This fixes #35067. It will require a Crater run as discussed in that
issue.
|
|
|
|
Resolves #29212.
|
|
impl From<bool> for AtomicBool
This seems like an obvious omission from #45610. ~~I've used the same feature name and version in the hope that this can be backported to beta so it's stabilized with the other impls. If it can't be I'll change it to `1.24.0`.~~
|
|
Stabilize const-calling existing const-fns in std
Fixes #46038
|
|
|
|
|
|
|
|
Fixes #46038
|
|
|
|
closes #45802
|
|
|
|
|
|
|
|
This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
|
|
|
|
docs improvement sync::atomic::Atomic*
Addresses the `Atomic*` part of #29377.
r? @steveklabnik
|
|
|
|
This includes the following stabilizations:
- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640
|
|
|
|
|
|
|
|
|
|
|
|
when compiling the crate for a target with max-atomic-width = 0
fixes #42097
|
|
Update docs of 'fence'
This PR updates the docs for `std::sync::atomic::fence` with an example and a diagram.
Part of #29377.
r? @steveklabnik
|
|
|
|
|
|
This addresses concerns raised following the merge of #41092.
Specifically:
> The naming of these seems surprising: the multithreaded functions (and
> both the single and multithreaded intrinsics themselves) are fences,
> but this is a barrier. It's not incorrect, but the latter is both
> inconsistent with the existing functions and slightly confusing with
> another type in std (e.g., `Barrier`).
`compiler_fence` carries the same semantic implication that this is a
compiler-only operation, while being more in line with the fence/barrier
concepts already in use in `std`.
|
|
Add safe wrapper for atomic_compilerfence intrinsics
This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888](https://github.com/rust-lang/rfcs/pull/888). See #41091 for further discussion.
|
|
|
|
|
|
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs.
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
|
|
|
|
Add a note about overflow for fetch_add/fetch_sub
Fixes #40916
Fixes #34618
r? @steveklabnik
|