mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
Support polling with select() by using a zero timeout.
Use this in WindowServer to avoid getting blocked in select() when there are pending injected events.
This commit is contained in:
parent
a01e119e05
commit
dff5051905
4 changed files with 24 additions and 7 deletions
|
@ -110,7 +110,11 @@ void WSEventLoop::wait_for_event()
|
|||
params.readfds = &rfds;
|
||||
params.writefds = nullptr;
|
||||
params.exceptfds = nullptr;
|
||||
params.timeout = nullptr;
|
||||
struct timeval timeout = { 0, 0 };
|
||||
if (m_queued_events.is_empty())
|
||||
params.timeout = nullptr;
|
||||
else
|
||||
params.timeout = &timeout;
|
||||
int rc = m_server_process->sys$select(¶ms);
|
||||
memory_barrier();
|
||||
if (rc < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue