File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ use futures_core::future::{Future, FutureObj};
4
4
use futures_core:: task:: { Context , Poll , Spawn , SpawnError } ;
5
5
use futures_util:: future:: FutureExt ;
6
6
use futures_util:: task:: { ArcWake , waker_ref} ;
7
+ use std:: cmp;
8
+ use std:: fmt;
7
9
use std:: io;
8
- use std:: sync:: { Arc , Mutex } ;
9
10
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
10
11
use std:: sync:: mpsc;
12
+ use std:: sync:: { Arc , Mutex } ;
11
13
use std:: thread;
12
- use std:: fmt;
13
14
14
15
/// A general-purpose thread pool for scheduling tasks that poll futures to
15
16
/// completion.
@@ -203,7 +204,7 @@ impl ThreadPoolBuilder {
203
204
/// See the other methods on this type for details on the defaults.
204
205
pub fn new ( ) -> ThreadPoolBuilder {
205
206
ThreadPoolBuilder {
206
- pool_size : num_cpus:: get ( ) ,
207
+ pool_size : cmp :: max ( 1 , num_cpus:: get ( ) ) ,
207
208
stack_size : 0 ,
208
209
name_prefix : None ,
209
210
after_start : None ,
You can’t perform that action at this time.
0 commit comments