about summary refs log tree commit diff
path: root/library/std/src/sync/mpsc
AgeCommit message (Collapse)AuthorLines
2023-02-17std: add regression test for #107466joboet-0/+13
Tests that messages are immediately dropped once the last receiver is destroyed.
2023-01-10add `SyncSender::send_timeout` testIbraheem Ahmed-0/+17
2022-12-04remove no-op 'let _ = 'Ralf Jung-9/+3
2022-11-14avoid memory leak in mpsc testRalf Jung-2/+3
2022-11-09remove mention of rust-lang#39364 from mpsc docsIbraheem Ahmed-28/+0
2022-11-09add test case for rust-lang#39364Ibraheem Ahmed-0/+14
2022-11-09implement `sync::mpsc` as a wrapper around `sync::mpmc`Ibraheem Ahmed-2798/+24
2022-11-08clarify licensing situation of mpsc and spsc queuePietro Albini-2/+17
2022-10-25more dupe typos againRageking8-1/+1
2022-08-18make many std tests work in MiriRalf Jung-17/+23
2022-06-01use 128 cache align for m1 macyifei-1/+2
2022-05-29Use Box::new() instead of box syntax in std testsest31-17/+17
2022-04-08Remove ptr-int transmute in std::sync::mpscBen Kimock-49/+50
Since https://github.com/rust-lang/rust/pull/95340 landed, Miri with -Zmiri-check-number-validity produces an error on the test suites of some crates which implement concurrency tools, because it seems like such crates tend to use std::sync::mpsc in their tests. This fixes the problem by storing pointer bytes in a pointer.
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-11/+11
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-10-26Remove redundant AlignerTony Yang-5/+2
The `Aligner` struct seems to be unnecessary. Previously noted by @arthurprs https://github.com/rust-lang/rust/pull/44963#discussion_r145340754 Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/ Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f
2021-09-22Update library/std/src/sync/mpsc/shared.rsMara Bos-1/+1
2021-09-05rust fmtlovasoa-1/+5
2021-09-03Add a better error message for #39364Ophir LOJKINE-1/+1
There is a known bug in the implementation of mpsc channels in rust. This adds a clearer error message when the bug occurs, so that developers don't lose too much time looking for the origin of the bug. See https://github.com/rust-lang/rust/issues/39364
2021-07-29Fix may not to appropriate might not or must notAli Malik-3/+3
2021-06-23Use HTTPS links where possibleSmitty-3/+3
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-12-22Migrate standard library away from compare_and_swapLinus Färnstrand-9/+31
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-1517/+1513
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/+5386