about summary refs log tree commit diff
path: root/library/std/src/sync/condvar.rs
AgeCommit message (Collapse)AuthorLines
2025-01-02Move some things to `std::sync::poison` and reexport them in `std::sync`Pavel Grigorenko-569/+0
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-06Adjust doc comment of Condvar::wait_whileUlrik Mikaelsson-2/+6
The existing phrasing implies that a notification must be received for `wait_while` to return. The phrasing is changed to better reflect the behavior.
2024-07-06Remove non-focused memory leak in `std` doctest for Miri.Zachary S-0/+3
2024-06-18Replace `move||` with `move ||` in `compiler/` and `library/`Vonr-8/+8
Edit from #126631 to revert changes on ui tests
2024-03-12std: move `Once` implementations to `sys`joboet-1/+1
2023-07-30Fix the example in document for WaitTimeoutResult::timed_outyukang-10/+8
2022-11-06std: remove lock wrappers in `sys_common`joboet-1/+1
2022-06-06Make {Mutex, Condvar, RwLock}::new() const.Mara Bos-0/+1
2022-06-06Make all {Mutex, Condvar, RwLock}::new #[inline].Mara Bos-1/+2
2022-04-14Remove use of `#[rustc_deprecated]`Jacob Pratt-1/+1
2021-10-30Add #[must_use] to remaining std functions (O-Z)John Kugelman-0/+1
2021-10-10Add #[must_use] to core and std constructorsJohn Kugelman-0/+1
2021-07-29Fix may not to appropriate might not or must notAli Malik-3/+3
2021-04-22Move `sys_common::poison` to `sync::poison`Christiaan Dirkx-2/+1
2021-04-21Replace all `fmt.pad` with `debug_struct`Christiaan Dirkx-1/+1
2020-10-02Move boxing and mutex checking logic of condvar into sys_common.Mara Bos-40/+4
2020-09-27Split sys_common::Mutex in StaticMutex and MovableMutex.Mara Bos-2/+2
The (unsafe) Mutex from sys_common had a rather complicated interface. You were supposed to call init() manually, unless you could guarantee it was neither moved nor used reentrantly. Calling `destroy()` was also optional, although it was unclear if 1) resources might be leaked or not, and 2) if destroy() should only be called when `init()` was called. This allowed for a number of interesting (confusing?) different ways to use this Mutex, all captured in a single type. In practice, this type was only ever used in two ways: 1. As a static variable. In this case, neither init() nor destroy() are called. The variable is never moved, and it is never used reentrantly. It is only ever locked using the LockGuard, never with raw_lock. 2. As a Boxed variable. In this case, both init() and destroy() are called, it will be moved and possibly used reentrantly. No other combinations are used anywhere in `std`. This change simplifies things by splitting this Mutex type into two types matching the two use cases: StaticMutex and MovableMutex. The interface of both new types is now both safer and simpler. The first one does not call nor expose init/destroy, and the second one calls those automatically in its new() and Drop functions. Also, the locking functions of MovableMutex are no longer unsafe.
2020-09-19Relax promises about condition variable.Mara Bos-11/+5
This allows for futex or thread parking based implementations in the future.
2020-09-06Auto merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAusbors-9/+9
Use Arc::clone and Rc::clone in documentation This PR replaces uses of `x.clone()` by `Rc::clone(&x)` (or `Arc::clone(&x)`) to better match the documentation for those types. @rustbot modify labels: T-doc
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-215/+3
Also doing fmt inplace as requested.
2020-08-30Move to Arc::clone(&x) over x.clone() in library/stdAlexis Bourget-9/+9
2020-08-22Use intra-doc-links in `std::sync::*`LeSeulArtichaut-21/+18
2020-07-27mv std libs to library/mark-0/+818