summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_unix_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-10-25 12:38:13 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-15 03:29:29 +0100
commitf927efd77a8e75e330b3592996277ad6e6eb6a8d (patch)
treeb7226a2eb337446a9a256b28fae469d9847b5b3b /src/corelib/kernel/qeventdispatcher_unix_p.h
parentdbfa6518890f4e6c4af6da92df45803ecfe0309a (diff)
Add support for Linux eventfd(7) in the UNIX event loop
eventfd(7) uses less resources than a pipe, as it only needs to store a single 64-bit integer, as opposed to a full buffer. It was introduced first on Linux version 2.6.22 and glibc 2.7. However, both the configure-time test and the runtime usage require the use of EFD_CLOEXEC for thread-safety, so this code will be enabled only for Linux 2.6.27 and up as well as glibc 2.9 and up. Change-Id: Ic7e10b28d7b1d4ca24be614ed84055c4429a68e4 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_unix_p.h')
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 98ea19ced8..e96acf65af 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -148,6 +148,9 @@ public:
virtual int processThreadWakeUp(int nsel);
bool mainThread;
+
+ // note for eventfd(7) support:
+ // if thread_pipe[1] is -1, then eventfd(7) is in use and is stored in thread_pipe[0]
int thread_pipe[2];
// highest fd for all socket notifiers