diff options
Diffstat (limited to 'tokio/src/runtime/blocking.rs')
-rw-r--r-- | tokio/src/runtime/blocking.rs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tokio/src/runtime/blocking.rs b/tokio/src/runtime/blocking.rs deleted file mode 100644 index 8408e78b..00000000 --- a/tokio/src/runtime/blocking.rs +++ /dev/null @@ -1,41 +0,0 @@ -//! Abstracts out the APIs necessary to `Runtime` for integrating the blocking -//! pool. When the `blocking` feature flag is **not** enabled. These APIs are -//! shells. This isolates the complexity of dealing with conditional -//! compilation. - -cfg_blocking_impl! { - pub(crate) use crate::blocking::BlockingPool; - pub(crate) use crate::blocking::Spawner; - - use crate::runtime::Builder; - - pub(crate) fn create_blocking_pool(builder: &Builder) -> BlockingPool { - BlockingPool::new(builder.thread_name.clone(), builder.thread_stack_size) - } -} - -cfg_not_blocking_impl! { - use crate::runtime::Builder; - - #[derive(Debug, Clone)] - pub(crate) struct BlockingPool {} - - pub(crate) use BlockingPool as Spawner; - - pub(crate) fn create_blocking_pool(_builder: &Builder) -> BlockingPool { - BlockingPool {} - } - - impl BlockingPool { - pub(crate) fn spawner(&self) -> &BlockingPool { - self - } - - pub(crate) fn enter<F, R>(&self, f: F) -> R - where - F: FnOnce() -> R, - { - f() - } - } -} |