summary refs log tree commit diff
path: root/src/libcore/sync
AgeCommit message (Collapse)AuthorLines
2018-04-19Auto merge of #48553 - seanmonstar:atomic-debug, r=alexcrichtonbors-5/+3
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.
2018-04-16Auto merge of #49963 - llogiq:stabilize-13226, r=kennytmbors-12/+11
stabilize fetch_nand This closes #13226 and makes `Atomic*.fetch_nand` stable.
2018-04-14stabilize fetch_nandAndre Bogus-12/+11
2018-04-12improve Atomic*::fetch_update docsAndre Bogus-2/+2
2018-04-05Rollup merge of #48658 - llogiq:no-more-cas, r=kennytmkennytm-0/+185
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.
2018-03-30Add a generic CAS loop to std::sync::Atomic*Andre Bogus-0/+185
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.
2018-03-26Rollup merge of #49170 - steveklabnik:gh49127, r=nagisaTim Neumann-2/+5
Clarify AcqRel's docs This implied things that are not true. Fixes #49127
2018-03-25update wording as per feedbackSteve Klabnik-1/+3
2018-03-19Make Atomic doc examples specific to each typeGuillaume Gomez-364/+401
2018-03-19Clarify AcqRel's docssteveklabnik-2/+3
This implied things that are not true. Fixes #49127
2018-02-26atomic: remove 'Atomic*' from Debug outputSean McArthur-5/+3
2018-02-16Force the link to std::thread::yield_now()Stefan Schindler-1/+1
2018-02-16Add link to yield_nowStefan Schindler-3/+4
2018-02-09Add fetch_nand.Mark Simulacrum-0/+46
cc #13226 (the tracking issue)
2018-01-28Auto merge of #47204 - varkor:unsafecell-into_inner-safe, r=alexcrichtonbors-3/+3
Make UnsafeCell::into_inner safe This fixes #35067. It will require a Crater run as discussed in that issue.
2018-01-05Make UnsafeCell::into_inner safevarkor-3/+3
This fixes #35067. It will require a Crater run as discussed in that issue.
2017-12-27Correct a few stability attributesOliver Middleton-1/+12
2017-12-10Add `std::fmt::Pointer` implementation for `AtomicPtr`varkor-0/+8
Resolves #29212.
2017-11-29Rollup merge of #46293 - ollie27:atomic_bool_from, r=BurntSushikennytm-0/+7
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`.~~
2017-11-29Rollup merge of #46287 - SimonSapin:stable-constness, r=aturonkennytm-14/+1
Stabilize const-calling existing const-fns in std Fixes #46038
2017-11-27Change version number for `impl From<bool> for AtomicBool` to 1.24.0Oliver Middleton-1/+1
2017-11-27Change the stabilization version to 1.24.0Stjepan Glavina-1/+1
2017-11-27impl From<bool> for AtomicBoolOliver Middleton-0/+7
2017-11-26Stabilize const-calling existing const-fns in stdSimon Sapin-14/+1
Fixes #46038
2017-11-22Stabilize spin_loop_hintStjepan Glavina-3/+2
2017-11-09fix core for targets with max-atomic-width = 0Jorge Aparicio-0/+1
closes #45802
2017-10-31since = "1.23.0"M Farkas-Dyck-2/+2
2017-10-29feature = "atomic_from"M Farkas-Dyck-2/+2
2017-10-29impl From<T> for AtomicTM Farkas-Dyck-0/+12
2017-10-26Bump to 1.23 and update bootstrapAlex Crichton-3/+3
This commit updates the bootstrap compiler, bumps the version to 1.23, updates Cargo, updates books, and updates crates.io dependencies
2017-10-05Add missing links for AtomicBoolGuillaume Gomez-5/+12
2017-09-29Rollup merge of #44854 - lucasem:atomic-docs, r=steveklabnikMark Simulacrum-1/+25
docs improvement sync::atomic::Atomic* Addresses the `Atomic*` part of #29377. r? @steveklabnik
2017-09-25docs improvement sync::atomic::Atomic*Lucas Morales-1/+25
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-1/+1
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
2017-09-16Added more text from unstable-book to `compiler_fence` docsMichal Budzynski-4/+19
2017-09-16Added example to `compiler_fence` docs taken from unstable-bookMichal Budzynski-0/+34
2017-09-16stabilized compiler_fences (fixes #41091)Michal Budzynski-1/+1
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-1/+14
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-05-18core: fix unused_macro warningJorge Aparicio-0/+1
when compiling the crate for a target with max-atomic-width = 0 fixes #42097
2017-05-02Rollup merge of #41217 - topecongiro:docs/atomic-fence, r=steveklabnikCorey Farwell-3/+52
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
2017-05-01Added spin loop pause functionSteven Stewart-Gallus-0/+23
2017-05-01Add an example for 'fence'topecongiro-3/+52
2017-04-13Rename compiler_barrier to compiler_fenceJon Gjengset-6/+6
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`.
2017-04-08Auto merge of #41092 - jonhoo:std-fence-intrinsics, r=alexcrichtonbors-0/+41
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.
2017-04-07Replace compare_exchange with swapStjepan Glavina-8/+3
2017-04-07Optimize AtomicBool::fetch_nandStjepan Glavina-9/+13
2017-04-06Fix Markdown issues in the docsOliver Middleton-2/+3
* 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.
2017-04-06Add unstable book entryJon Gjengset-1/+1
2017-04-05Rollup merge of #40927 - stjepang:docs-atomic-overflow-note, r=alexcrichtonAriel Ben-Yehuda-10/+29
Add a note about overflow for fetch_add/fetch_sub Fixes #40916 Fixes #34618 r? @steveklabnik