diff --git a/src/runtime2/poll/mod.rs b/src/runtime2/poll/mod.rs index 2fc67d21192fb736ee7a12b58581c0f86bc42aaf..86225ca65fe06aead14e60095c4592e216bf3638 100644 --- a/src/runtime2/poll/mod.rs +++ b/src/runtime2/poll/mod.rs @@ -177,6 +177,7 @@ impl PollingThread { } pub(crate) fn run(&mut self) { + use std::io::ErrorKind; use crate::runtime2::communication::Message; const NUM_EVENTS: usize = 256; @@ -191,7 +192,23 @@ impl PollingThread { loop { // Retrieve events first (because the PollingClient will first // register at epoll, and then push a command into the queue). - self.poller.wait(&mut events, EPOLL_DURATION).unwrap(); + loop { + let wait_result = self.poller.wait(&mut events, EPOLL_DURATION); + match wait_result { + Ok(()) => break, + Err(reason) => { + match reason.kind() { + ErrorKind::Interrupted => { + // Happens when we're debugging and set a break- + // point, we want to continue waiting + }, + _ => { + panic!("failed to poll: {}", reason); + } + } + } + } + } // Then handle everything in the command queue. while let Some(command) = self.queue.pop() {