From 6b3eb83bffeab268fd892a06bac1da051b168929 Mon Sep 17 00:00:00 2001 From: rbehjati Date: Fri, 22 Mar 2024 14:27:11 +0000 Subject: [PATCH] Move mpsc::Sender to the list of Send + Sync types (#1930) As of 1.72.0, `mpsc::Sender` [is `Sync`](https://doc.rust-lang.org/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E). --- src/concurrency/send-sync/examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concurrency/send-sync/examples.md b/src/concurrency/send-sync/examples.md index 7fffa9b9..1bc78d73 100644 --- a/src/concurrency/send-sync/examples.md +++ b/src/concurrency/send-sync/examples.md @@ -9,6 +9,7 @@ Most types you come across are `Send + Sync`: - `String`, `Option`, `Vec`, `Box`, ... - `Arc`: Explicitly thread-safe via atomic reference count. - `Mutex`: Explicitly thread-safe via internal locking. +- `mpsc::Sender`: As of 1.72.0. - `AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions. The generic types are typically `Send + Sync` when the type parameters are @@ -19,7 +20,6 @@ The generic types are typically `Send + Sync` when the type parameters are These types can be moved to other threads, but they're not thread-safe. Typically because of interior mutability: -- `mpsc::Sender` - `mpsc::Receiver` - `Cell` - `RefCell`