1
0
Fork 0
forked from wry/wry

autocommit 2022-03-22 23:24:17 CET

This commit is contained in:
Julian Orth 2022-03-22 23:24:17 +01:00
parent 18806a38fb
commit 2ff60ff817
36 changed files with 4934 additions and 237 deletions

View file

@ -151,10 +151,10 @@ impl EventLoop {
fn run_(&self) -> Result<(), EventLoopError> {
self.check_destroyed()?;
let mut buf = [c::epoll_event { events: 0, u64: 0 }; 16];
while !self.destroyed.get() {
'outer: while !self.destroyed.get() {
while let Some(id) = self.scheduled.borrow_mut().pop_front() {
if self.destroyed.get() {
break;
break 'outer;
}
if let Some(entry) = self.entries.get(&id) {
if let Err(e) = entry.dispatcher.clone().dispatch(0) {
@ -162,6 +162,9 @@ impl EventLoop {
}
}
}
if self.destroyed.get() {
break 'outer;
}
let num = match uapi::epoll_wait(self.epoll.raw(), &mut buf, -1) {
Ok(n) => n,
Err(Errno(c::EINTR)) => continue,
@ -169,7 +172,7 @@ impl EventLoop {
};
for event in &buf[..num] {
if self.destroyed.get() {
break;
break 'outer;
}
let id = event.u64;
let entry = match self.entries.get(&id) {