diff options
| author | Ralf Jung <post@ralfj.de> | 2023-01-15 16:46:17 -0500 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-01-15 16:46:17 -0500 |
| commit | b23795229781a2125fade078fa610bc47cc75b16 (patch) | |
| tree | c57813bd1e93312f265ead2df13e5a9f885b17e9 /library/std/src/sync/mpmc/array.rs | |
| parent | ec5f8253e28a660034a3936a171f93a3c063a0cc (diff) | |
| parent | fa2ff4d7e5a88bfda186f0f3f621402470745788 (diff) | |
Merge from rustc
Diffstat (limited to 'library/std/src/sync/mpmc/array.rs')
| -rw-r--r-- | library/std/src/sync/mpmc/array.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/std/src/sync/mpmc/array.rs b/library/std/src/sync/mpmc/array.rs index f71edc6c525..c1e3e48b044 100644 --- a/library/std/src/sync/mpmc/array.rs +++ b/library/std/src/sync/mpmc/array.rs @@ -168,7 +168,7 @@ impl<T> Channel<T> { return true; } Err(_) => { - backoff.spin(); + backoff.spin_light(); tail = self.tail.load(Ordering::Relaxed); } } @@ -182,11 +182,11 @@ impl<T> Channel<T> { return false; } - backoff.spin(); + backoff.spin_light(); tail = self.tail.load(Ordering::Relaxed); } else { // Snooze because we need to wait for the stamp to get updated. - backoff.snooze(); + backoff.spin_heavy(); tail = self.tail.load(Ordering::Relaxed); } } @@ -251,7 +251,7 @@ impl<T> Channel<T> { return true; } Err(_) => { - backoff.spin(); + backoff.spin_light(); head = self.head.load(Ordering::Relaxed); } } @@ -273,11 +273,11 @@ impl<T> Channel<T> { } } - backoff.spin(); + backoff.spin_light(); head = self.head.load(Ordering::Relaxed); } else { // Snooze because we need to wait for the stamp to get updated. - backoff.snooze(); + backoff.spin_heavy(); head = self.head.load(Ordering::Relaxed); } } @@ -330,7 +330,7 @@ impl<T> Channel<T> { if backoff.is_completed() { break; } else { - backoff.spin(); + backoff.spin_light(); } } |
