mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Share the "blocked-on file descriptor" number between read() and write().
A process can't be reading and writing at the same time, so it's fine for them to share the variable for the blocked FD.
This commit is contained in:
parent
f6e27c2abe
commit
4bc87dc7b9
3 changed files with 3 additions and 4 deletions
|
@ -49,9 +49,9 @@ bool Scheduler::pick_next()
|
|||
}
|
||||
|
||||
if (process.state() == Process::BlockedRead) {
|
||||
ASSERT(process.m_fdBlockedOnRead != -1);
|
||||
ASSERT(process.m_blocked_fd != -1);
|
||||
// FIXME: Block until the amount of data wanted is available.
|
||||
if (process.m_fds[process.m_fdBlockedOnRead].descriptor->has_data_available_for_reading())
|
||||
if (process.m_fds[process.m_blocked_fd].descriptor->has_data_available_for_reading())
|
||||
process.unblock();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue