We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 642a324 commit 4e9e465Copy full SHA for 4e9e465
library/std/src/sync/mpmc/array.rs
@@ -464,14 +464,15 @@ impl<T> Channel<T> {
464
/// ordering or stronger.
465
pub(crate) unsafe fn disconnect_receivers(&self) -> bool {
466
let tail = self.tail.fetch_or(self.mark_bit, Ordering::SeqCst);
467
- self.discard_all_messages(tail);
468
-
469
- if tail & self.mark_bit == 0 {
+ let disconnected = if tail & self.mark_bit == 0 {
470
self.senders.disconnect();
471
true
472
} else {
473
false
474
- }
+ };
+
+ self.discard_all_messages(tail);
475
+ disconnected
476
}
477
478
/// Discards all messages.
0 commit comments