Browse Source

prevent infinite loop in cleanup code for

io_close-with-outstanding-events-queued race prevention
master
Felix von Leitner 8 months ago
parent
commit
874530bace
  1. 9
      io/io_waituntil2.c

9
io/io_waituntil2.c

@ -123,12 +123,11 @@ int64 io_waituntil2(int64 milliseconds) {
if (first_deferred!=-1) {
while (first_deferred!=-1) {
io_entry* e=iarray_get(&io_fds,first_deferred);
if (e) {
if (e->closed) {
e->closed=0;
close(first_deferred);
}
if (e && e->closed) {
e->closed=0;
close(first_deferred);
first_deferred=e->next_defer;
e->next_defer=-1;
} else
first_deferred=-1; // can't happen
}

Loading…
Cancel
Save