Skip to content

Commit e101c89

Browse files
seanmonstarcramertj
authored andcommitted
Remove unused lazy static GLOBAL_POOL
1 parent 03f8b38 commit e101c89

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

futures-executor/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ Executors for asynchronous tasks based on the futures-rs library.
1515
name = "futures_executor"
1616

1717
[features]
18-
std = ["num_cpus", "futures-core-preview/std", "futures-util-preview/std", "futures-channel-preview/std", "lazy_static"]
18+
std = ["num_cpus", "futures-core-preview/std", "futures-util-preview/std", "futures-channel-preview/std"]
1919
default = ["std"]
2020

2121
[dependencies]
2222
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.13", default-features = false}
2323
futures-util-preview = { path = "../futures-util", version = "=0.3.0-alpha.13", default-features = false}
2424
futures-channel-preview = { path = "../futures-channel", version = "=0.3.0-alpha.13", default-features = false}
2525
num_cpus = { version = "1.8.0", optional = true }
26-
lazy_static = { version = "1.1.0", optional = true }
2726
pin-utils = "0.1.0-alpha.4"
2827

2928
[dev-dependencies]

futures-executor/src/local_pool.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{enter, ThreadPool};
1+
use crate::enter;
22
use futures_core::future::{Future, FutureObj, LocalFutureObj};
33
use futures_core::stream::{Stream};
44
use futures_core::task::{
@@ -8,7 +8,6 @@ use futures_core::task::{
88
use futures_util::task::{WakerRef, waker_ref, ArcWake};
99
use futures_util::stream::FuturesUnordered;
1010
use futures_util::stream::StreamExt;
11-
use lazy_static::lazy_static;
1211
use pin_utils::pin_mut;
1312
use std::cell::{RefCell};
1413
use std::ops::{Deref, DerefMut};
@@ -192,17 +191,9 @@ impl Default for LocalPool {
192191
}
193192
}
194193

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-
202194
/// Run a future to completion on the current thread.
203195
///
204196
/// This function will block the caller until the given future has completed.
205-
/// The default spawner for the future is a thread-local executor.
206197
///
207198
/// Use a [`LocalPool`](LocalPool) if you need finer-grained control over
208199
/// spawned tasks.
@@ -215,7 +206,6 @@ pub fn block_on<F: Future>(f: F) -> F::Output {
215206
///
216207
/// When `next` is called on the resulting `BlockingStream`, the caller
217208
/// will be blocked until the next element of the `Stream` becomes available.
218-
/// The default spawner for the future is a global `ThreadPool`.
219209
pub fn block_on_stream<S: Stream + Unpin>(stream: S) -> BlockingStream<S> {
220210
BlockingStream { stream }
221211
}

0 commit comments

Comments
 (0)