File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
crossbeam-channel/src/flavors Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ impl<T> Channel<T> {
582
582
}
583
583
584
584
let mut head = self . head . index . load ( Ordering :: Acquire ) ;
585
- let mut block = self . head . block . load ( Ordering :: Acquire ) ;
585
+ let mut block = self . head . block . swap ( ptr :: null_mut ( ) , Ordering :: AcqRel ) ;
586
586
587
587
// If we're going to be dropping messages we need to synchronize with initialization
588
588
if head >> SHIFT != tail >> SHIFT {
@@ -595,6 +595,7 @@ impl<T> Channel<T> {
595
595
block = self . head . block . load ( Ordering :: Acquire ) ;
596
596
}
597
597
}
598
+
598
599
unsafe {
599
600
// Drop all messages between head and tail and deallocate the heap-allocated blocks.
600
601
while head >> SHIFT != tail >> SHIFT {
@@ -623,7 +624,6 @@ impl<T> Channel<T> {
623
624
}
624
625
}
625
626
head &= !MARK_BIT ;
626
- self . head . block . store ( ptr:: null_mut ( ) , Ordering :: Release ) ;
627
627
self . head . index . store ( head, Ordering :: Release ) ;
628
628
}
629
629
You can’t perform that action at this time.
0 commit comments