From fac2cb08f1b80d0bd03586996da99aa42877adcb Mon Sep 17 00:00:00 2001 From: blankie Date: Tue, 7 Mar 2023 20:55:24 +0700 Subject: [PATCH] Reduce amount of epoll events --- logcat_thread.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/logcat_thread.cpp b/logcat_thread.cpp index 9c2ef41..f4934cf 100644 --- a/logcat_thread.cpp +++ b/logcat_thread.cpp @@ -16,8 +16,6 @@ #include "logcat_thread.h" #include "logcat_entry.h" -#define EPOLL_MAX_EVENTS 10 - static void mark_nonblock(int fd) { int flags = fcntl(fd, F_GETFL); if (flags < 0) { @@ -223,9 +221,9 @@ void LogcatThread::_run_read_round() { }; #ifdef USE_EPOLL - struct epoll_event events[EPOLL_MAX_EVENTS]; + struct epoll_event events[2]; - int ready_fds = epoll_wait(this->_epoll_fd, events, EPOLL_MAX_EVENTS, 1000); + int ready_fds = epoll_wait(this->_epoll_fd, events, 2, 1000); if (ready_fds == -1) { if (errno == EINTR) { return;