Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix typos
Co-authored-by: Ralf Jung <post@ralfj.de>
  • Loading branch information
ibraheemdev and RalfJung authored Feb 29, 2024
commit 7c9fa952c3be1f7d0872fe9cd5f1f4a0327771b9
6 changes: 3 additions & 3 deletions library/std/src/sync/mpmc/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ impl<T> Channel<T> {
}

let mut head = self.head.index.load(Ordering::Acquire);
// the channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts
// to initalize the first block before noticing that the receivers disconnected. late allocations
// will be deallocated by the sender in Drop
// The channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts
// to initalize the first block before noticing that the receivers disconnected. Late allocations
// will be deallocated by the sender in Drop.
let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel);

// If we're going to be dropping messages we need to synchronize with initialization
Expand Down