Linux: Use eventfd rather than a pipe for loop wakeup

This commit is contained in:
Kovid Goyal
2019-07-05 14:54:54 +05:30
parent c848c3ee0d
commit 29ad6fba22
2 changed files with 22 additions and 0 deletions

View File

@@ -15,8 +15,15 @@
#include <sys/signalfd.h>
#endif
#if __has_include(<sys/eventfd.h>)
#define HAS_EVENT_FD
#include <sys/eventfd.h>
#endif
typedef struct {
#ifndef HAS_EVENT_FD
int wakeup_fds[2];
#endif
#ifndef HAS_SIGNAL_FD
int signal_fds[2];
#endif