Reduce amount of epoll events
This commit is contained in:
parent
626e081876
commit
fac2cb08f1
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue