From 07802b2c8487c6e70e39d0b0cd6bf7705fc88337 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 12 Oct 2020 15:15:40 -0400 Subject: rt: `worker_threads` must be non-zero (#2947) Co-authored-by: Alice Ryhl --- benches/signal.rs | 5 ++--- benches/sync_semaphore.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'benches') diff --git a/benches/signal.rs b/benches/signal.rs index fcad40da..4d5f58fd 100644 --- a/benches/signal.rs +++ b/benches/signal.rs @@ -45,9 +45,8 @@ fn many_signals(bench: &mut Bencher) { let num_signals = 10; let (tx, mut rx) = mpsc::channel(num_signals); - let rt = runtime::Builder::new_multi_thread() - // Intentionally single threaded to measure delays in propagating wakes - .worker_threads(0) + // Intentionally single threaded to measure delays in propagating wakes + let rt = runtime::Builder::new_current_thread() .enable_all() .build() .unwrap(); diff --git a/benches/sync_semaphore.rs b/benches/sync_semaphore.rs index 19a1dd33..17b26148 100644 --- a/benches/sync_semaphore.rs +++ b/benches/sync_semaphore.rs @@ -49,8 +49,7 @@ fn uncontended_concurrent_multi(b: &mut Bencher) { } fn uncontended_concurrent_single(b: &mut Bencher) { - let rt = tokio::runtime::Builder::new_multi_thread() - .worker_threads(0) + let rt = tokio::runtime::Builder::new_current_thread() .build() .unwrap(); -- cgit v1.2.3