summaryrefslogtreecommitdiffstats
path: root/tokio-executor
diff options
context:
space:
mode:
authormatthieugras <35115728+matthieugras@users.noreply.github.com>2019-07-15 17:56:20 +0200
committerCarl Lerche <me@carllerche.com>2019-07-15 08:56:20 -0700
commit0b75c0c53d7708e42af5b72adb58f2261f7d9fe1 (patch)
tree458cb4463f5a637e076a796328053ccc0e1acf52 /tokio-executor
parent5fbb36a060c3eb3317b50e9f58c264ac81f86608 (diff)
executor: block thread when needed in block fn (#1303)
Fix #1296
Diffstat (limited to 'tokio-executor')
-rw-r--r--tokio-executor/src/enter.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tokio-executor/src/enter.rs b/tokio-executor/src/enter.rs
index d09994c6..c10675fc 100644
--- a/tokio-executor/src/enter.rs
+++ b/tokio-executor/src/enter.rs
@@ -70,7 +70,7 @@ impl Enter {
use std::task::Context;
use std::task::Poll::Ready;
- let park = ParkThread::new();
+ let mut park = ParkThread::new();
let waker = park.unpark().into_waker();
let mut cx = Context::from_waker(&waker);
@@ -82,6 +82,7 @@ impl Enter {
if let Ready(v) = f.as_mut().poll(&mut cx) {
return v;
}
+ park.park().unwrap();
}
}
}