Skip to content

Commit 8144fbb

Browse files
taiki-eibraheemdev
andcommitted
Remove optimistic spinning from Context::wait_until
Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
1 parent a92f6c4 commit 8144fbb

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

crossbeam-channel/src/context.rs

-15
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,6 @@ impl Context {
138138
/// If the deadline is reached, `Selected::Aborted` will be selected.
139139
#[inline]
140140
pub fn wait_until(&self, deadline: Option<Instant>) -> Selected {
141-
// Spin for a short time, waiting until an operation is selected.
142-
let backoff = Backoff::new();
143-
loop {
144-
let sel = Selected::from(self.inner.select.load(Ordering::Acquire));
145-
if sel != Selected::Waiting {
146-
return sel;
147-
}
148-
149-
if backoff.is_completed() {
150-
break;
151-
} else {
152-
backoff.snooze();
153-
}
154-
}
155-
156141
loop {
157142
// Check whether an operation has been selected.
158143
let sel = Selected::from(self.inner.select.load(Ordering::Acquire));

0 commit comments

Comments
 (0)