Skip to content

Commit

Permalink
Remove update_sockets_events_if_polling
Browse files Browse the repository at this point in the history
It is now longer needed, now we update the socket events in all cases.
  • Loading branch information
Thomasdezeeuw committed Nov 7, 2019
1 parent ad9d116 commit 6fc3ba8
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/sys/windows/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl SelectorInner {
socket.set_sock_state(Some(sock));
unsafe {
self.add_socket_to_update_queue(socket);
self.update_sockets_events_if_polling()?;
self.update_sockets_events()?;
}

Ok(())
Expand Down Expand Up @@ -543,7 +543,7 @@ impl SelectorInner {
}
unsafe {
self.add_socket_to_update_queue(socket);
self.update_sockets_events_if_polling()?;
self.update_sockets_events()?;
}

Ok(())
Expand Down Expand Up @@ -574,15 +574,6 @@ impl SelectorInner {
Ok(())
}

unsafe fn update_sockets_events_if_polling(&self) -> io::Result<()> {
// FIXME: only do this while polling.
let active_poll_count = 1; //*self.active_poll_count.lock();
if active_poll_count > 0 {
return self.update_sockets_events();
}
Ok(())
}

unsafe fn add_socket_to_update_queue<S: SocketState>(&self, socket: &S) {
let sock_state = socket.get_sock_state().unwrap();
let mut update_queue = self.update_queue.lock().unwrap();
Expand Down

0 comments on commit 6fc3ba8

Please sign in to comment.