| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2025-03-22 | Implement `UniqueArc` | Frank King | -0/+2 | |
| 2025-01-02 | Move some things to `std::sync::poison` and reexport them in `std::sync` | Pavel Grigorenko | -19/+37 | |
| 2024-09-30 | Add multi-producer, multi-consumer channel (mpmc) | Obei Sideg | -1/+8 | |
| 2024-09-22 | Reformat using the new identifier sorting from rustfmt | Michael Goulet | -3/+3 | |
| 2024-09-13 | Update tests for hidden references to mutable static | Obei Sideg | -0/+3 | |
| 2024-07-29 | Reformat `use` declarations. | Nicholas Nethercote | -10/+9 | |
| The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options. | ||||
| 2024-06-15 | std: suggest OnceLock over Once | Jubilee Young | -1/+2 | |
| 2024-06-11 | replace version placeholder | Pietro Albini | -1/+1 | |
| 2024-06-02 | Differ LazyLock vs. OnceLock in std::sync overview | Jubilee Young | -1/+4 | |
| 2024-02-20 | Stabilize `LazyCell` and `LazyLock` (`lazy_cell`) | Peter Jaszkowiak | -1/+1 | |
| 2024-02-29 | Rollup merge of #110543 - joboet:reentrant_lock, r=m-ou-se | Matthias Krüger | -2/+3 | |
| Make `ReentrantLock` public Implements the ACP rust-lang/libs-team#193. ``@rustbot`` label +T-libs-api +S-waiting-on-ACP | ||||
| 2024-02-23 | std: make `ReentrantLock` public | joboet | -2/+3 | |
| 2023-12-05 | Fix Condvar typo, add public re-exports of Mapped*Guard. | Zachary S | -0/+4 | |
| 2023-04-28 | replace version placeholders | Pietro Albini | -1/+1 | |
| 2023-03-29 | Documentation updates to better share the purpose of OnceCell/OnceLock | Trevor Gross | -1/+4 | |
| 2023-03-29 | Stabilize a portion of 'once_cell' | Trevor Gross | -2/+2 | |
| Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try' | ||||
| 2023-01-26 | std: optimize `LazyLock` size | joboet | -1/+1 | |
| 2022-11-14 | std: move `ReentrantMutex` to `sync` | joboet | -0/+3 | |
| 2022-11-09 | initial port of crossbeam-channel | Ibraheem Ahmed | -0/+1 | |
| 2022-06-30 | Rollup merge of #97629 - guswynn:exclusive_struct, r=m-ou-se | Matthias Krüger | -0/+2 | |
| [core] add `Exclusive` to sync (discussed here: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Adding.20.60SyncWrapper.60.20to.20std) `Exclusive` is a wrapper that exclusively allows mutable access to the inner value if you have exclusive access to the wrapper. It acts like a compile time mutex, and hold an unconditional `Sync` implementation. ## Justification for inclusion into std - This wrapper unblocks actual problems: - The example that I hit was a vector of `futures::future::BoxFuture`'s causing a central struct in a script to be non-`Sync`. To work around it, you either write really difficult code, or wrap the futures in a needless mutex. - Easy to maintain: this struct is as simple as a wrapper can get, and its `Sync` implementation has very clear reasoning - Fills a gap: `&/&mut` are to `RwLock` as `Exclusive` is to `Mutex` ## Public Api ```rust // core::sync #[derive(Default)] struct Exclusive<T: ?Sized> { ... } impl<T: ?Sized> Sync for Exclusive {} impl<T> Exclusive<T> { pub const fn new(t: T) -> Self; pub const fn into_inner(self) -> T; } impl<T: ?Sized> Exclusive<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn get_pin_mut(Pin<&mut self>) -> Pin<&mut T>; pub const fn from_mut(&mut T) -> &mut Exclusive<T>; pub const fn from_pin_mut(Pin<&mut T>) -> Pin<&mut Exclusive<T>>; } impl<T: Future> Future for Exclusive { ... } impl<T> From<T> for Exclusive<T> { ... } impl<T: ?Sized> Debug for Exclusive { ... } ``` ## Naming This is a big bikeshed, but I felt that `Exclusive` captured its general purpose quite well. ## Stability and location As this is so simple, it can be in `core`. I feel that it can be stabilized quite soon after it is merged, if the libs teams feels its reasonable to add. Also, I don't really know how unstable feature work in std/core's codebases, so I might need help fixing them ## Tips for review The docs probably are the thing that needs to be reviewed! I tried my best, but I'm sure people have more experience than me writing docs for `Core` ### Implementation: The API is mostly pulled from https://docs.rs/sync_wrapper/latest/sync_wrapper/struct.SyncWrapper.html (which is apache 2.0 licenesed), and the implementation is trivial: - its an unsafe justification for pinning - its an unsafe justification for the `Sync` impl (mostly reasoned about by ````@danielhenrymantilla```` here: https://github.com/Actyx/sync_wrapper/pull/2) - and forwarding impls, starting with derivable ones and `Future` | ||||
| 2022-06-23 | add tracking issue for exclusive | Gus Wynn | -1/+1 | |
| 2022-06-16 | Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock` | Maybe Waffle | -0/+7 | |
| 2022-06-07 | [core] add Exclusive to sync | Gus Wynn | -0/+2 | |
| 2022-03-10 | Use implicit capture syntax in format_args | T-O-R-U-S | -1/+1 | |
| This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored). | ||||
| 2021-04-22 | Move `sys_common::poison` to `sync::poison` | Christiaan Dirkx | -2/+3 | |
| 2020-07-27 | mv std libs to library/ | mark | -0/+179 | |
