This commit is contained in:
Stjepan Glavina 2020-06-19 12:05:54 +02:00
parent 3f2945c94c
commit 61f52189b7
3 changed files with 3 additions and 21 deletions

View File

@ -47,7 +47,6 @@ optional = true
libc = "0.2.70"
[target.'cfg(windows)'.dependencies]
miow = "0.3.5"
wepoll-binding = "2.0.2"
winapi = { version = "0.3.8", features = ["ioapiset"] }
[patch.crates-io]

View File

@ -72,27 +72,16 @@ impl IoEvent {
#[cfg(windows)]
pub fn notify(&self) {
use std::os::windows::io::*;
use std::mem::*;
use std::os::windows::io::*;
use winapi::um::ioapiset::PostQueuedCompletionStatus;
use winapi::um::minwinbase::OVERLAPPED;
use miow::iocp::*;
use miow::*;
let reactor = crate::reactor::Reactor::get();
let handle = reactor.sys.0.as_raw_handle();
atomic::fence(Ordering::SeqCst);
unsafe {
let port = ManuallyDrop::new(CompletionPort::from_raw_handle(handle));
let status = CompletionStatus::zero();
port.post(status);
// PostQueuedCompletionStatus(
// 0,
// 0,
// zero as *const OVERLAPPED as *mut OVERLAPPED,
// );
PostQueuedCompletionStatus(reactor.sys.0.as_raw_handle(), 0, 0, 0 as *mut _);
}
}

View File

@ -1205,13 +1205,7 @@ static int port__feed_events(port_state_t* port_state,
(IO_STATUS_BLOCK*) iocp_events[i].lpOverlapped;
struct epoll_event* ev = &epoll_events[epoll_event_count];
if (io_status_block)
epoll_event_count += sock_feed_event(port_state, io_status_block, ev);
else {
ev->events = 0;
ev->data = 1000000;
epoll_event_count += 1;
}
epoll_event_count += sock_feed_event(port_state, io_status_block, ev);
}
return epoll_event_count;