Skip to content

Commit

Permalink
Use load instead of get_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
vnetserg committed Jan 27, 2024
1 parent be6b4bc commit f93c704
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokio/src/sync/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,10 @@ impl<'a, T> Drop for Recv<'a, T> {
let mut tail = self.receiver.shared.tail.lock();

// Safety: tail lock is held.
// `Relaxed` order suffices because we hold the tail lock.
let queued = self
.waiter
.with_mut(|ptr| unsafe { *(*ptr).queued.get_mut() });
.with_mut(|ptr| unsafe { (*ptr).queued.load(Relaxed) });

if queued {
// Remove the node
Expand Down

0 comments on commit f93c704

Please sign in to comment.