summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/runtime/context.rs')
-rw-r--r--tokio/src/runtime/context.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/tokio/src/runtime/context.rs b/tokio/src/runtime/context.rs
index 1b267f48..c42b3432 100644
--- a/tokio/src/runtime/context.rs
+++ b/tokio/src/runtime/context.rs
@@ -7,8 +7,10 @@ thread_local! {
static CONTEXT: RefCell<Option<Handle>> = RefCell::new(None)
}
-pub(crate) fn current() -> Option<Handle> {
- CONTEXT.with(|ctx| ctx.borrow().clone())
+cfg_blocking_impl! {
+ pub(crate) fn current() -> Option<Handle> {
+ CONTEXT.with(|ctx| ctx.borrow().clone())
+ }
}
cfg_io_driver! {