This commit is contained in:
Ibraheem Ahmed 2022-10-17 19:55:10 -04:00
parent f2b5e27a60
commit 209168655a
4 changed files with 4 additions and 5 deletions

View file

@ -169,7 +169,7 @@ impl<T> Channel<T> {
}
Err(_) => {
backoff.spin();
tail = self.load(Ordering::Relaxed);
tail = self.tail.load(Ordering::Relaxed);
}
}
} else if stamp.wrapping_add(self.one_lap) == tail + 1 {
@ -250,7 +250,7 @@ impl<T> Channel<T> {
token.array.stamp = head.wrapping_add(self.one_lap);
return true;
}
Err(h) => {
Err(_) => {
backoff.spin();
head = self.head.load(Ordering::Relaxed);
}

View file

@ -1,7 +1,6 @@
//! Thread-local channel context.
use super::select::Selected;
use super::utils::Backoff;
use crate::cell::Cell;
use crate::ptr;

View file

@ -350,7 +350,7 @@ impl<T> Channel<T> {
token.list.offset = offset;
return true;
},
Err(h) => {
Err(_) => {
backoff.spin();
head = self.head.index.load(Ordering::Acquire);
block = self.head.block.load(Ordering::Acquire);

View file

@ -111,7 +111,7 @@ impl Backoff {
#[inline]
pub fn spin(&self) {
let step = self.step.get().min(SPIN_LIMIT);
for _ in 0..step.pow(2) {
for _ in 0..step.pow(2) {
crate::hint::spin_loop();
}