diff options
| author | Ibraheem Ahmed <ibraheem@ibraheem.ca> | 2022-10-17 19:36:46 -0400 |
|---|---|---|
| committer | Ibraheem Ahmed <ibraheem@ibraheem.ca> | 2022-11-09 23:20:02 -0500 |
| commit | f2966d1d0c439db338705200e58d55fb6f300469 (patch) | |
| tree | 2e8464ed969daa3cdbed0ebc0b238c619ff93a70 /library/std/src | |
| parent | 8dddb2294310ad3e8ce0b2af735a702ad72a9a99 (diff) | |
| download | rust-f2966d1d0c439db338705200e58d55fb6f300469.tar.gz rust-f2966d1d0c439db338705200e58d55fb6f300469.zip | |
remove extra spinning from `mpsc` parker
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sync/mpmc/context.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/library/std/src/sync/mpmc/context.rs b/library/std/src/sync/mpmc/context.rs index 83197ae3de8..dea6880017d 100644 --- a/library/std/src/sync/mpmc/context.rs +++ b/library/std/src/sync/mpmc/context.rs @@ -115,21 +115,6 @@ impl Context { /// If the deadline is reached, `Selected::Aborted` will be selected. #[inline] pub fn wait_until(&self, deadline: Option<Instant>) -> Selected { - // Spin for a short time, waiting until an operation is selected. - let backoff = Backoff::new(); - loop { - let sel = Selected::from(self.inner.select.load(Ordering::Acquire)); - if sel != Selected::Waiting { - return sel; - } - - if backoff.is_completed() { - break; - } else { - backoff.snooze(); - } - } - loop { // Check whether an operation has been selected. let sel = Selected::from(self.inner.select.load(Ordering::Acquire)); |
