mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
tidy
This commit is contained in:
parent
f2b5e27a60
commit
209168655a
@ -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);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
//! Thread-local channel context.
|
||||
|
||||
use super::select::Selected;
|
||||
use super::utils::Backoff;
|
||||
|
||||
use crate::cell::Cell;
|
||||
use crate::ptr;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user