diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-16 22:02:53 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-16 22:06:33 +0200 |
commit | c3379e3734cf3557f2251985e06c5707bcec6ade (patch) | |
tree | 02d009af67aca38adc1c8d30572c3b555ef9cc1b /Libraries/LibCore | |
parent | b19367096780194a6941563c60954cadd9c8b4c9 (diff) | |
download | serenity-c3379e3734cf3557f2251985e06c5707bcec6ade.zip |
LibCore: Always wait_for_events() when pumping the event loop
This fixes an issue where continuously posting new events to the queue
would keep the event loop saturated, causing it to ignore notifiers.
Since notifiers are part of the big select(), we always have to call
wait_for_events() even if there are pending events. We're already smart
enough to select() without a timeout if we already have pending events.
Diffstat (limited to 'Libraries/LibCore')
-rw-r--r-- | Libraries/LibCore/EventLoop.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp index ca745468e0..0c1e48073e 100644 --- a/Libraries/LibCore/EventLoop.cpp +++ b/Libraries/LibCore/EventLoop.cpp @@ -320,8 +320,7 @@ int EventLoop::exec() void EventLoop::pump(WaitMode mode) { - if (m_queued_events.is_empty()) - wait_for_event(mode); + wait_for_event(mode); decltype(m_queued_events) events; { |