From 6a0ecef81a27d3c928f88b578a5ea23c2fbd218b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 2 May 2018 01:33:41 +0200 Subject: [PATCH] Timer: always park nested Park (#327) The nested `Park` might need to do some work, even if the duration is 0 seconds (e.g. a `Reactor`). Similar to what #313 did for CurrentThread. --- tokio-timer/src/timer/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tokio-timer/src/timer/mod.rs b/tokio-timer/src/timer/mod.rs index 1ebdb6241..89c5eb25e 100644 --- a/tokio-timer/src/timer/mod.rs +++ b/tokio-timer/src/timer/mod.rs @@ -478,6 +478,8 @@ where T: Park, if deadline > now { self.park.park_timeout(deadline - now)?; + } else { + self.park.park_timeout(Duration::from_secs(0))?; } } None => { @@ -500,6 +502,8 @@ where T: Park, if deadline > now { self.park.park_timeout(cmp::min(deadline - now, duration))?; + } else { + self.park.park_timeout(Duration::from_secs(0))?; } } None => {