mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Implement basic support for POSIX-style select().
Now we can block on both the PTY *and* the GUI event stream in Terminal.
This commit is contained in:
parent
46181cf023
commit
10387beda7
8 changed files with 164 additions and 30 deletions
|
@ -64,6 +64,22 @@ bool Scheduler::pick_next()
|
|||
return true;
|
||||
}
|
||||
|
||||
if (process.state() == Process::BlockedSelect) {
|
||||
for (int fd : process.m_select_read_fds) {
|
||||
if (process.m_fds[fd].descriptor->has_data_available_for_reading(process)) {
|
||||
process.unblock();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (int fd : process.m_select_write_fds) {
|
||||
if (process.m_fds[fd].descriptor->can_write(process)) {
|
||||
process.unblock();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (process.state() == Process::Skip1SchedulerPass) {
|
||||
process.set_state(Process::Skip0SchedulerPasses);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue