From ba078648fb90dcd326c175caba1caef290de749a Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Tue, 17 May 2022 21:11:37 +0100 Subject: [PATCH] Add spin loop hints for Miri --- crossbeam-deque/tests/injector.rs | 4 ++++ crossbeam-deque/tests/lifo.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crossbeam-deque/tests/injector.rs b/crossbeam-deque/tests/injector.rs index 478f7ee87..f706a8d9c 100644 --- a/crossbeam-deque/tests/injector.rs +++ b/crossbeam-deque/tests/injector.rs @@ -61,6 +61,8 @@ fn spsc() { assert_eq!(i, v); break; } + #[cfg(miri)] + std::hint::spin_loop(); } } @@ -102,6 +104,8 @@ fn mpmc() { v[n].fetch_add(1, SeqCst); break; } + #[cfg(miri)] + std::hint::spin_loop(); } } }); diff --git a/crossbeam-deque/tests/lifo.rs b/crossbeam-deque/tests/lifo.rs index ce04c6159..c1a65cd2e 100644 --- a/crossbeam-deque/tests/lifo.rs +++ b/crossbeam-deque/tests/lifo.rs @@ -87,6 +87,8 @@ fn spsc() { assert_eq!(i, v); break; } + #[cfg(miri)] + std::hint::spin_loop(); } }