From cde387d7e728f227db41a0d73e1a9ed9a9e2a2d0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 19 Dec 2017 14:18:28 -0800 Subject: [PATCH] Touch up documentation for `Reactor::turn` --- src/reactor/mod.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/reactor/mod.rs b/src/reactor/mod.rs index a52894ec0..f3f1c7e8e 100644 --- a/src/reactor/mod.rs +++ b/src/reactor/mod.rs @@ -144,13 +144,19 @@ impl Reactor { /// /// # Return value /// - /// This function returns an instance of `Turn` or `io::Error`. + /// This function returns an instance of `Turn` /// - /// `Turn` as of today has no extra information with it and can be safely discarded. - /// In the future `Turn` may contain information about what happened while this - /// reactor blocked. + /// `Turn` as of today has no extra information with it and can be safely + /// discarded. In the future `Turn` may contain information about what + /// happened while this reactor blocked. /// - /// `io::Error` is possible when there is an internal `tokio` bug or I/O error. + /// # Errors + /// + /// This function may also return any I/O error which occurs when polling + /// for readiness of I/O objects with the OS. This is quite unlikely to + /// arise and typically mean that things have gone horribly wrong at that + /// point. Currently this is primarily only known to happen for internal + /// bugs to `tokio` itself. pub fn turn(&mut self, max_wait: Option) -> io::Result { self.poll(max_wait)?; Ok(Turn { _priv: () }) @@ -171,7 +177,6 @@ impl Reactor { let token = event.token(); trace!("event {:?} {:?}", event.readiness(), event.token()); - if token == TOKEN_WAKEUP { self.inner.wakeup.set_readiness(mio::Ready::empty()).unwrap(); } else {