Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused lazy static GLOBAL_POOL #1485

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions futures-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ 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]
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.13", default-features = false}
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]
Expand Down
12 changes: 1 addition & 11 deletions futures-executor/src/local_pool.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand All @@ -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};
Expand Down Expand Up @@ -192,17 +191,9 @@ impl Default for LocalPool {
}
}

lazy_static! {
static ref GLOBAL_POOL: ThreadPool = ThreadPool::builder()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh-- too bad this didn't generate a warning :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.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.
Expand All @@ -215,7 +206,6 @@ pub fn block_on<F: Future>(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<S: Stream + Unpin>(stream: S) -> BlockingStream<S> {
BlockingStream { stream }
}
Expand Down