mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
Respond to alexchrichton's comments
* Combine the FreeBSD/Dragonfly platform with the other Unix platform * Remove the Windows platform::aio method * Update deps
This commit is contained in:
+2
-2
@@ -19,12 +19,12 @@ appveyor = { repository = "alexcrichton/tokio-core" }
|
||||
[dependencies]
|
||||
bytes = "0.4"
|
||||
log = "0.3"
|
||||
mio = { git = "https://github.com/carllerche/mio", rev = "d8576d9" }
|
||||
mio = "0.6.9"
|
||||
scoped-tls = "0.1.0"
|
||||
slab = "0.3"
|
||||
iovec = "0.1"
|
||||
tokio-io = "0.1"
|
||||
futures = "0.1.11"
|
||||
futures = "0.1.14"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = { version = "0.3", default-features = false }
|
||||
|
||||
+1
-52
@@ -775,54 +775,7 @@ fn usize2ready(bits: usize) -> mio::Ready {
|
||||
ready | platform::usize2ready(bits)
|
||||
}
|
||||
|
||||
#[cfg(all(unix, not(any(target_os = "freebsd", target_os = "dragonfly"))))]
|
||||
mod platform {
|
||||
use mio::Ready;
|
||||
use mio::unix::UnixReady;
|
||||
|
||||
pub fn aio() -> Ready {
|
||||
// Even though some of these platforms define EVFILT_AIO, they
|
||||
// don't implement it with their reactors, so there's no point
|
||||
// to using it.
|
||||
Ready::empty()
|
||||
}
|
||||
|
||||
pub fn all() -> Ready {
|
||||
hup()
|
||||
}
|
||||
|
||||
pub fn hup() -> Ready {
|
||||
UnixReady::hup().into()
|
||||
}
|
||||
|
||||
const HUP: usize = 1 << 2;
|
||||
const ERROR: usize = 1 << 3;
|
||||
|
||||
pub fn ready2usize(ready: Ready) -> usize {
|
||||
let ready = UnixReady::from(ready);
|
||||
let mut bits = 0;
|
||||
if ready.is_error() {
|
||||
bits |= ERROR;
|
||||
}
|
||||
if ready.is_hup() {
|
||||
bits |= HUP;
|
||||
}
|
||||
bits
|
||||
}
|
||||
|
||||
pub fn usize2ready(bits: usize) -> Ready {
|
||||
let mut ready = UnixReady::from(Ready::empty());
|
||||
if bits & HUP != 0 {
|
||||
ready.insert(UnixReady::hup());
|
||||
}
|
||||
if bits & ERROR != 0 {
|
||||
ready.insert(UnixReady::error());
|
||||
}
|
||||
ready.into()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
|
||||
#[cfg(unix)]
|
||||
mod platform {
|
||||
use mio::Ready;
|
||||
use mio::unix::UnixReady;
|
||||
@@ -877,10 +830,6 @@ mod platform {
|
||||
mod platform {
|
||||
use mio::Ready;
|
||||
|
||||
pub fn aio() -> Ready {
|
||||
Ready::empty()
|
||||
}
|
||||
|
||||
pub fn all() -> Ready {
|
||||
// No platform-specific Readinesses for Windows
|
||||
Ready::empty()
|
||||
|
||||
Reference in New Issue
Block a user