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/buffer_utils.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/buffer_utils.cc')
| -rw-r--r-- | src/buffer_utils.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index 206dc4b7..69cdb574 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -133,7 +133,7 @@ Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, bool scroll struct FifoWatcher : FDWatcher { FifoWatcher(int fd, Buffer& buffer, bool scroll) - : FDWatcher(fd, FdEvents::Read, + : FDWatcher(fd, FdEvents::Read, EventMode::Normal, [](FDWatcher& watcher, FdEvents, EventMode mode) { if (mode == EventMode::Normal) static_cast<FifoWatcher&>(watcher).read_fifo(); |
