We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 829308e + 580b003 commit fc3800fCopy full SHA for fc3800f
library/std/src/sync/mpmc/list.rs
@@ -547,7 +547,7 @@ impl<T> Channel<T> {
547
}
548
549
let mut head = self.head.index.load(Ordering::Acquire);
550
- let mut block = self.head.block.load(Ordering::Acquire);
+ let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel);
551
552
// If we're going to be dropping messages we need to synchronize with initialization
553
if head >> SHIFT != tail >> SHIFT {
@@ -588,8 +588,8 @@ impl<T> Channel<T> {
588
drop(Box::from_raw(block));
589
590
591
+
592
head &= !MARK_BIT;
- self.head.block.store(ptr::null_mut(), Ordering::Release);
593
self.head.index.store(head, Ordering::Release);
594
595
0 commit comments