Skip to content

Commit

Permalink
Bug fix for the test without joining threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jan 21, 2024
1 parent 4759578 commit 505d85d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions benches/iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ macro_rules! contended_bench_iai {
.collect();
let mut main_thread_rng = rngs.pop().unwrap();
drop(root);
rngs.into_iter().for_each(|mut rng| {
rngs.into_iter().for_each(|mut rng| {
let iterations_left = iterations_left.clone();
spawn(move || {
while iterations_left.fetch_sub(1, SeqCst) > 0 {
Expand Down Expand Up @@ -83,8 +83,7 @@ macro_rules! contended_bench_iai {
black_box(rng.next_u64());
}
})
})
.collect();
});
while iterations_left.fetch_sub(1, SeqCst) > 0 {
black_box(main_thread_rng.next_u64());
}
Expand Down

0 comments on commit 505d85d

Please sign in to comment.