Skip to content

Commit d4572c7

Browse files
committed
executor: force initialization of async-io's reactor
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
1 parent 98c08f8 commit d4572c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/task/executor.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ where
4646
let waker = async_task::waker_fn(move || unparker.unpark());
4747
let cx = &mut Context::from_waker(&waker);
4848
pin_utils::pin_mut!(future);
49+
// Force initialization of async-io's Reactor before running.
50+
executor.parker.park_timeout(std::time::Duration::from_millis(0));
4951
loop {
5052
if let Poll::Ready(res) = future.as_mut().poll(cx) {
5153
return res;

0 commit comments

Comments
 (0)