Skip to content
Permalink
Browse files

much smaller wait

  • Loading branch information...
abby
abby committed Mar 25, 2019
1 parent a850ed6 commit 67ff0f3dc8e33467125a7fe6b5a57b25747678eb
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/wait.rs
@@ -31,8 +31,6 @@ pub fn load_tagless(val: &AtomicUsize) -> usize {
#[inline(always)]
pub fn check(seq: usize, at: &AtomicUsize, wc: &AtomicUsize) -> bool {
let cur_count = load_tagless(at);
use std::{thread, time};
thread::sleep(time::Duration::from_millis(50));
wc.load(Relaxed) == 0 || seq == cur_count || past(seq, cur_count).1
}

@@ -125,6 +123,9 @@ impl Wait for BusyWait {
if check(seq, w_pos, wc) {
return;
}

use std::{thread, time};
thread::sleep(time::Duration::from_nanos(1000));
}
}

0 comments on commit 67ff0f3

Please sign in to comment.
You can’t perform that action at this time.