rust/library/std/src/sync
Yuki Okushi 2d2f1a5e88
Rollup merge of #80269 - pickfire:patch-4, r=joshtriplett
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-15 17:39:58 +09:00
..
barrier std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
condvar Disable condvar::two_mutexes test on non-unix platforms. 2020-10-02 09:47:08 +02:00
mpsc Rollup merge of #80269 - pickfire:patch-4, r=joshtriplett 2021-06-15 17:39:58 +09:00
mutex std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
once Stabilize poison API of Once, rename poisoned() 2021-02-04 15:20:14 +01:00
rwlock std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
barrier.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
condvar.rs Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
mod.rs Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
mutex.rs minor rewording after review 2021-05-24 09:24:35 -05:00
once.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
poison.rs Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
rwlock.rs Multiple improvements to RwLocks 2021-06-01 09:07:55 +02:00