diff --git a/src/executor/current_thread/mod.rs b/src/executor/current_thread/mod.rs index e61fdd2ca..a5035d64c 100644 --- a/src/executor/current_thread/mod.rs +++ b/src/executor/current_thread/mod.rs @@ -353,7 +353,9 @@ impl CurrentThread

{ self.enter(&mut enter).run_timeout(duration) } - /// Perform a single iteration of the event loop + /// Perform a single iteration of the event loop. + /// + /// This function blocks the current thread even if the executor is idle. pub fn turn(&mut self, duration: Option) -> Result { @@ -462,15 +464,12 @@ impl<'a, P: Park> Entered<'a, P> { self.run_timeout2(Some(duration)) } - /// Perform a single iteration of the event loop + /// Perform a single iteration of the event loop. + /// + /// This function blocks the current thread even if the executor is idle. pub fn turn(&mut self, duration: Option) -> Result { - if self.executor.is_idle() { - // Nothing to do - return Ok(Turn(())); - } - if !self.tick() { let res = match duration { Some(duration) => self.executor.park.park_timeout(duration),