Skip to content

Commit

Permalink
Add spin loop hints for Miri
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed May 17, 2022
1 parent 6f52bea commit ba07864
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crossbeam-deque/tests/injector.rs
Expand Up @@ -61,6 +61,8 @@ fn spsc() {
assert_eq!(i, v);
break;
}
#[cfg(miri)]
std::hint::spin_loop();
}
}

Expand Down Expand Up @@ -102,6 +104,8 @@ fn mpmc() {
v[n].fetch_add(1, SeqCst);
break;
}
#[cfg(miri)]
std::hint::spin_loop();
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions crossbeam-deque/tests/lifo.rs
Expand Up @@ -87,6 +87,8 @@ fn spsc() {
assert_eq!(i, v);
break;
}
#[cfg(miri)]
std::hint::spin_loop();
}
}

Expand Down

0 comments on commit ba07864

Please sign in to comment.