summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qwaitcondition.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-22 20:06:57 -0700
committerThiago Macieira <thiago.macieira@intel.com>2018-03-03 20:53:26 +0000
commitfd207c06b81b12086bdf80e4fa7b393bf1f424d6 (patch)
tree1ef07d6c699ed66647207c9b42edbec2f11743d7 /src/corelib/thread/qwaitcondition.h
parent8c04a5e9640df0f1b2f533ee5fa698e2f466ad1f (diff)
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 <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/thread/qwaitcondition.h')
-rw-r--r--src/corelib/thread/qwaitcondition.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/thread/qwaitcondition.h b/src/corelib/thread/qwaitcondition.h
index a0c6766833..e42efbdfca 100644
--- a/src/corelib/thread/qwaitcondition.h
+++ b/src/corelib/thread/qwaitcondition.h
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_THREAD
+class QDeadlineTimer;
class QWaitConditionPrivate;
class QMutex;
class QReadWriteLock;
@@ -59,8 +60,11 @@ public:
QWaitCondition();
~QWaitCondition();
+ // ### Qt 6: remove unsigned long overloads
bool wait(QMutex *lockedMutex, unsigned long time = ULONG_MAX);
+ bool wait(QMutex *lockedMutex, QDeadlineTimer deadline);
bool wait(QReadWriteLock *lockedReadWriteLock, unsigned long time = ULONG_MAX);
+ bool wait(QReadWriteLock *lockedReadWriteLock, QDeadlineTimer deadline);
void wakeOne();
void wakeAll();