4a01a38466
Implement `Sync` for `mpsc::Sender` `mpsc::Sender` is currently `!Sync` because the previous implementation contained an optimization where the channel started out as single-producer and was dynamically upgraded on the first clone, which relied on a unique reference to the sender. This optimization is one of the main reasons the old implementation was so complex and was removed in #93563. `mpsc::Sender` can now soundly implement `Sync`. Note for any potential confusion, this chance does *not* add MPMC behavior. This only affects the already `Send + Clone` *sender*, not *receiver*. It's technically possible to rely on the `!Sync` behavior in the same way as a `PhantomData<*mut T>`, but that seems very unlikely in practice. Either way, this change is insta-stable and needs an FCP. `@rustbot` label +T-libs-api -T-libs |
||
---|---|---|
.. | ||
backtrace | ||
collections | ||
env | ||
error | ||
f32 | ||
f64 | ||
ffi | ||
fs | ||
io | ||
net | ||
num | ||
os | ||
panic | ||
path | ||
personality | ||
prelude | ||
process | ||
sync | ||
sys | ||
sys_common | ||
thread | ||
time | ||
alloc.rs | ||
ascii.rs | ||
backtrace.rs | ||
env.rs | ||
error.rs | ||
f32.rs | ||
f64.rs | ||
fs.rs | ||
keyword_docs.rs | ||
lib.rs | ||
macros.rs | ||
num.rs | ||
panic.rs | ||
panicking.rs | ||
path.rs | ||
personality.rs | ||
primitive_docs.rs | ||
process.rs | ||
rt.rs | ||
time.rs |