1
- use crate :: { enter, ThreadPool } ;
1
+ use crate :: enter;
2
2
use futures_core:: future:: { Future , FutureObj , LocalFutureObj } ;
3
3
use futures_core:: stream:: { Stream } ;
4
4
use futures_core:: task:: {
@@ -8,7 +8,6 @@ use futures_core::task::{
8
8
use futures_util:: task:: { WakerRef , waker_ref, ArcWake } ;
9
9
use futures_util:: stream:: FuturesUnordered ;
10
10
use futures_util:: stream:: StreamExt ;
11
- use lazy_static:: lazy_static;
12
11
use pin_utils:: pin_mut;
13
12
use std:: cell:: { RefCell } ;
14
13
use std:: ops:: { Deref , DerefMut } ;
@@ -192,17 +191,9 @@ impl Default for LocalPool {
192
191
}
193
192
}
194
193
195
- lazy_static ! {
196
- static ref GLOBAL_POOL : ThreadPool = ThreadPool :: builder( )
197
- . name_prefix( "block_on-" )
198
- . create( )
199
- . expect( "Unable to create global thread-pool" ) ;
200
- }
201
-
202
194
/// Run a future to completion on the current thread.
203
195
///
204
196
/// This function will block the caller until the given future has completed.
205
- /// The default spawner for the future is a thread-local executor.
206
197
///
207
198
/// Use a [`LocalPool`](LocalPool) if you need finer-grained control over
208
199
/// spawned tasks.
@@ -215,7 +206,6 @@ pub fn block_on<F: Future>(f: F) -> F::Output {
215
206
///
216
207
/// When `next` is called on the resulting `BlockingStream`, the caller
217
208
/// will be blocked until the next element of the `Stream` becomes available.
218
- /// The default spawner for the future is a global `ThreadPool`.
219
209
pub fn block_on_stream < S : Stream + Unpin > ( stream : S ) -> BlockingStream < S > {
220
210
BlockingStream { stream }
221
211
}
0 commit comments