diff options
| author | Maxime Coste <mawww@kakoune.org> | 2021-03-11 09:02:02 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2021-03-11 09:02:02 +1100 |
| commit | 4a59018dcd766b1499d53e82ba938ce39013f7af (patch) | |
| tree | 3440e440ca210fbd6eb7d56d724af4b6144ffa4a /src/json_ui.cc | |
| parent | c12d1c16b789e92da8a1f087836ac75951db0a93 (diff) | |
Do not select on non-urgent fd when handling only urgent events
This avoids 100% CPU usage when we have pending fifo input while running
a shell process, as we will not end-up busy looping in pselect but not
reading the available data due to being only processing urgent events.
Diffstat (limited to 'src/json_ui.cc')
| -rw-r--r-- | src/json_ui.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/json_ui.cc b/src/json_ui.cc index 007c8ab0..111438c4 100644 --- a/src/json_ui.cc +++ b/src/json_ui.cc @@ -133,7 +133,7 @@ void rpc_call(StringView method, Args&&... args) } JsonUI::JsonUI() - : m_stdin_watcher{0, FdEvents::Read, + : m_stdin_watcher{0, FdEvents::Read, EventMode::Urgent, [this](FDWatcher&, FdEvents, EventMode mode) { parse_requests(mode); }}, m_dimensions{24, 80} |
