diff options
Diffstat (limited to 'src/runtime/thread_pool/mod.rs')
-rw-r--r-- | src/runtime/thread_pool/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/runtime/thread_pool/mod.rs b/src/runtime/thread_pool/mod.rs index ced9712..e39695a 100644 --- a/src/runtime/thread_pool/mod.rs +++ b/src/runtime/thread_pool/mod.rs @@ -9,9 +9,7 @@ use self::idle::Idle; mod worker; pub(crate) use worker::Launch; -cfg_blocking! { - pub(crate) use worker::block_in_place; -} +pub(crate) use worker::block_in_place; use crate::loom::sync::Arc; use crate::runtime::task::{self, JoinHandle}; @@ -91,7 +89,7 @@ impl fmt::Debug for ThreadPool { impl Drop for ThreadPool { fn drop(&mut self) { - self.spawner.shared.close(); + self.spawner.shutdown(); } } @@ -108,6 +106,10 @@ impl Spawner { self.shared.schedule(task, false); handle } + + pub(crate) fn shutdown(&mut self) { + self.shared.close(); + } } impl fmt::Debug for Spawner { |