From fd207c06b81b12086bdf80e4fa7b393bf1f424d6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 22 May 2016 20:06:57 -0700 Subject: Port QWaitCondition to QDeadlineTimer Since pthread_cond_timedwait takes absolute time instead of relative time like most POSIX API, there's a small gain in performance here: we avoid an extra system call to get the current time. Task-number: QTBUG-64266 Change-Id: I25d85d86649448d5b2b3fffd1451138568091f50 Reviewed-by: Edward Welbourne --- src/corelib/kernel/qdeadlinetimer.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/kernel/qdeadlinetimer.h') diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h index 6c10e1025e..1a4ee04a96 100644 --- a/src/corelib/kernel/qdeadlinetimer.h +++ b/src/corelib/kernel/qdeadlinetimer.h @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef max // un-pollute the namespace. We need std::numeric_limits::max() and std::chrono::duration::max() @@ -186,6 +187,10 @@ private: unsigned type; qint64 rawRemainingTimeNSecs() const Q_DECL_NOTHROW; + +public: + // This is not a public function, it's here only for Qt's internal convenience... + QPair _q_data() const { return qMakePair(t1, t2); } }; Q_DECLARE_SHARED(QDeadlineTimer) -- cgit v1.2.1