diff --git a/futures-executor/Cargo.toml b/futures-executor/Cargo.toml index 928a328644..b0b7114b11 100644 --- a/futures-executor/Cargo.toml +++ b/futures-executor/Cargo.toml @@ -15,7 +15,7 @@ Executors for asynchronous tasks based on the futures-rs library. name = "futures_executor" [features] -std = ["num_cpus", "futures-core-preview/std", "futures-util-preview/std", "futures-channel-preview/std", "lazy_static"] +std = ["num_cpus", "futures-core-preview/std", "futures-util-preview/std", "futures-channel-preview/std"] default = ["std"] [dependencies] @@ -23,7 +23,6 @@ futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.13", futures-util-preview = { path = "../futures-util", version = "=0.3.0-alpha.13", default-features = false} futures-channel-preview = { path = "../futures-channel", version = "=0.3.0-alpha.13", default-features = false} num_cpus = { version = "1.8.0", optional = true } -lazy_static = { version = "1.1.0", optional = true } pin-utils = "0.1.0-alpha.4" [dev-dependencies] diff --git a/futures-executor/src/local_pool.rs b/futures-executor/src/local_pool.rs index 083d3ebab7..06fa50933c 100644 --- a/futures-executor/src/local_pool.rs +++ b/futures-executor/src/local_pool.rs @@ -1,4 +1,4 @@ -use crate::{enter, ThreadPool}; +use crate::enter; use futures_core::future::{Future, FutureObj, LocalFutureObj}; use futures_core::stream::{Stream}; use futures_core::task::{ @@ -8,7 +8,6 @@ use futures_core::task::{ use futures_util::task::{WakerRef, waker_ref, ArcWake}; use futures_util::stream::FuturesUnordered; use futures_util::stream::StreamExt; -use lazy_static::lazy_static; use pin_utils::pin_mut; use std::cell::{RefCell}; use std::ops::{Deref, DerefMut}; @@ -192,17 +191,9 @@ impl Default for LocalPool { } } -lazy_static! { - static ref GLOBAL_POOL: ThreadPool = ThreadPool::builder() - .name_prefix("block_on-") - .create() - .expect("Unable to create global thread-pool"); -} - /// Run a future to completion on the current thread. /// /// This function will block the caller until the given future has completed. -/// The default spawner for the future is a thread-local executor. /// /// Use a [`LocalPool`](LocalPool) if you need finer-grained control over /// spawned tasks. @@ -215,7 +206,6 @@ pub fn block_on(f: F) -> F::Output { /// /// When `next` is called on the resulting `BlockingStream`, the caller /// will be blocked until the next element of the `Stream` becomes available. -/// The default spawner for the future is a global `ThreadPool`. pub fn block_on_stream(stream: S) -> BlockingStream { BlockingStream { stream } }