We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9d890ca + 3d83555 commit bda5928Copy full SHA for bda5928
1 file changed
src/config/mod.rs
@@ -90,14 +90,17 @@ pub fn init_runtime () -> std::io::Result<Runtime> {
90
.enable_io()
91
.build()
92
} else {
93
- let mut worker_threads = worker_threads.as_u64().unwrap_or(1) as usize;
94
- if worker_threads == 0 { worker_threads = 1 }
95
- Builder::new_multi_thread()
96
- .thread_name("librespeed-rs")
97
- .worker_threads(worker_threads)
98
- .enable_time()
99
- .enable_io()
100
- .build()
+ let worker_threads = worker_threads.as_u64().unwrap_or(1) as usize;
+ match worker_threads {
+ 0 | 1 => Builder::new_current_thread()
+ .enable_io()
+ .build(),
+ _ => Builder::new_multi_thread()
+ .thread_name("librespeed-rs")
+ .worker_threads(worker_threads)
101
102
103
+ }
104
}
105
106
0 commit comments