diff options
author | Max Kellermann <max@duempel.org> | 2013-01-10 00:08:25 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-10 00:10:01 +0100 |
commit | ecd5eb02c5094d3160db9d92937f7011e172c254 (patch) | |
tree | 10de3022544ec56b71865bc3cfd0c8a05607d5f0 /src/event/WakeFD.hxx | |
parent | 3be57dc4a30f1a4b059fec4bd7e46ae03d3c7107 (diff) | |
download | mpd-ecd5eb02c5094d3160db9d92937f7011e172c254.tar.gz mpd-ecd5eb02c5094d3160db9d92937f7011e172c254.tar.xz mpd-ecd5eb02c5094d3160db9d92937f7011e172c254.zip |
event/WakeFD: use eventfd() if available
Diffstat (limited to '')
-rw-r--r-- | src/event/WakeFD.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/event/WakeFD.hxx b/src/event/WakeFD.hxx index 7b2d52675..15b66b4cf 100644 --- a/src/event/WakeFD.hxx +++ b/src/event/WakeFD.hxx @@ -48,7 +48,9 @@ public: int Get() const { assert(fds[0] >= 0); +#ifndef HAVE_EVENTFD assert(fds[1] >= 0); +#endif return fds[0]; } @@ -64,6 +66,15 @@ public: * be combined to one wakeup. */ void Write(); + +private: +#ifdef HAVE_EVENTFD + bool IsEventFD() { + assert(fds[0] >= 0); + + return fds[1] == -2; + } +#endif }; #endif /* MAIN_NOTIFY_H */ |