With multiple input source support, there is a lag between asking a
device if it has data and then waiting for more data to appear. If an
interrupt signalling additional input arrives in this interval, we'll
go to sleep with input available.
This patch uses a big hammer by just disabling interrupts for the
whole process.
Signed-off-by: Keith Packard <keithp@keithp.com>
char c;
int8_t stdio = ao_cur_stdio;
char c;
int8_t stdio = ao_cur_stdio;
for (;;) {
c = stdios[stdio].pollchar();
if (c != AO_READ_AGAIN)
for (;;) {
c = stdios[stdio].pollchar();
if (c != AO_READ_AGAIN)
if (stdio == ao_cur_stdio)
ao_sleep(&ao_stdin_ready);
}
if (stdio == ao_cur_stdio)
ao_sleep(&ao_stdin_ready);
}
ao_cur_stdio = stdio;
return c;
}
ao_cur_stdio = stdio;
return c;
}