Revert changes to read_ready and add platform::all()

This commit is contained in:
Alan Somers 2017-05-21 11:01:48 -06:00
parent 81beb44565
commit 42f73cb0ec

View File

@ -469,8 +469,7 @@ impl Inner {
mio::Token(TOKEN_START + entry.index() * 2), mio::Token(TOKEN_START + entry.index() * 2),
mio::Ready::readable() | mio::Ready::readable() |
mio::Ready::writable() | mio::Ready::writable() |
platform::hup() | platform::all(),
platform::aio(),
mio::PollOpt::edge())); mio::PollOpt::edge()));
Ok((sched.readiness.clone(), entry.insert(sched).index())) Ok((sched.readiness.clone(), entry.insert(sched).index()))
} }
@ -748,7 +747,7 @@ impl<F: FnOnce(&Core) + Send + 'static> FnBox for F {
} }
fn read_ready() -> mio::Ready { fn read_ready() -> mio::Ready {
mio::Ready::readable() | platform::hup() | platform::aio() mio::Ready::readable() | platform::hup()
} }
const READ: usize = 1 << 0; const READ: usize = 1 << 0;
@ -788,6 +787,10 @@ mod platform {
Ready::empty() Ready::empty()
} }
pub fn all() -> Ready {
hup()
}
pub fn hup() -> Ready { pub fn hup() -> Ready {
UnixReady::hup().into() UnixReady::hup().into()
} }
@ -828,6 +831,10 @@ mod platform {
UnixReady::aio().into() UnixReady::aio().into()
} }
pub fn all() -> Ready {
hup() | aio()
}
pub fn hup() -> Ready { pub fn hup() -> Ready {
UnixReady::hup().into() UnixReady::hup().into()
} }
@ -874,6 +881,11 @@ mod platform {
Ready::empty() Ready::empty()
} }
pub fn all() -> Ready {
// No platform-specific Readinesses for Windows
Ready::empty()
}
pub fn hup() -> Ready { pub fn hup() -> Ready {
Ready::empty() Ready::empty()
} }