about summary refs log tree commit diff
path: root/library/std/src/sync/mpsc/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-01-26Move std::sync unit tests to integration testsbjorn3-1247/+0
This removes two minor OnceLock tests which test private methods. The rest of the tests should be more than enough to catch mistakes in those private methods. Also makes ReentrantLock::try_lock public. And finally it makes the mpmc tests actually run.
2024-11-10split up the first paragraph of doc comments for better summariesbinarycat-0/+2
2024-09-29Fix std tests for wasm32-wasip2 targetNicola Krumschmidt-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-18Replace `move||` with `move ||` in `compiler/` and `library/`Vonr-5/+5
Edit from #126631 to revert changes on ui tests
2023-08-18Remove Drop impl of mpsc Receiver and (Sync)SenderBen Schulz-15/+0
2023-08-12Update Sender documentation for SyncGurinder Singh-3/+2
2023-07-12Replace version placeholder to 1.72Mark Rousskov-1/+1
2023-06-10implement `Sync` for `mpsc::Sender`Ibraheem Ahmed-2/+2
2023-05-03Remove unnecessary Send boundGil Shoshan-2/+2
2023-01-10add `SyncSender::send_timeout` testIbraheem Ahmed-0/+9
2022-12-04remove no-op 'let _ = 'Ralf Jung-9/+3
2022-11-09remove mention of rust-lang#39364 from mpsc docsIbraheem Ahmed-28/+0
2022-11-09implement `sync::mpsc` as a wrapper around `sync::mpmc`Ibraheem Ahmed-406/+24
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-10/+10
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).
2022-01-03Make `Receiver::into_iter` into a clickable linkzohnannor-1/+2
The documentation on `std::sync::mpsc::Iter` and `std::sync::mpsc::TryIter` provides links to the corresponding `Receiver` methods, unlike `std::sync::mpsc::IntoIter` does. This was left out in c59b188aaeadea32625534250d1f5120420be000 Related to #29377
2021-10-30Add #[must_use] to remaining std functions (O-Z)John Kugelman-0/+2
2021-06-15Rollup merge of #80269 - pickfire:patch-4, r=joshtriplettYuki Okushi-7/+46
Explain non-dropped sender recv in docs Original senders that are still hanging around could cause Receiver::recv to not block since this is a potential footgun for beginners, clarify more on this in the docs for readers to be aware about it. Maybe it would be better to show an example of the pattern where `drop(tx)` is used when it is being cloned multiple times? Although I have seen it in quite a few articles but I am surprised that this part is not very clear with the current words without careful reading. > If the corresponding Sender has disconnected, or it disconnects while this call is blocking, this call will wake up and return Err to indicate that no more messages can ever be received on this channel. However, since channels are buffered, messages sent before the disconnect will still be properly received. Some words there may seemed similar if I carefully read and relate it but if I am new, I probably does not know "drop" makes it "disconnected". So I mention the words "drop" and "alive" to make it more relatable to lifetime.
2021-06-12Explain non-dropped sender recv in docsIvan Tham-7/+46
Original senders that are still hanging around could cause Receiver::recv to not block since this is a potential footgun for beginners, clarify more on this in the docs for readers to be aware about it. Fix minor tidbits in sender recv doc Co-authored-by: Dylan DPC <dylan.dpc@gmail.com> Add example for unbounded receive loops in doc Show the drop(tx) pattern, based on tokio docs https://tokio-rs.github.io/tokio/doc/tokio/sync/index.html Fix example code for drop sender recv Fix wording in sender docs Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-04-21Replace all `fmt.pad` with `debug_struct`Christiaan Dirkx-1/+1
2021-03-27Use DebugStruct::finish_non_exhaustive() in std.Mara Bos-3/+3
2021-03-01Add diagnostic itemsCameron Steffen-0/+1
2020-11-07Convert a bunch of intra-doc linksCamelid-3/+0
2020-09-21Applied review commentsErik Hofmayer-0/+6
2020-09-20Documented From impls in std/sync/mpsc/mod.rsErik Hofmayer-0/+9
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-1361/+6
Also doing fmt inplace as requested.
2020-08-22Use intra-doc-links in `std::sync::*`LeSeulArtichaut-86/+22
2020-07-27mv std libs to library/mark-0/+3033