summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-11-08 21:16:55 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-11-13 19:34:07 +0100
commitf2cf5f5417d4df68eb0677e375cb81e39286c05f (patch)
treece75f050fbd02cfd106471ddcf046e8e22b818fc /src/corelib/thread/qthread.h
parentf2cc6fd4a0734e442f1101e3277215ea9d44d0d2 (diff)
Port QThread::wait() to QDeadlineTimer
So we are in sync with QWaitCondition::wait(). Task-number: QTBUG-64266 Change-Id: I1d7487786513241cedd35d202c4ddee4937b08ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread/qthread.h')
-rw-r--r--src/corelib/thread/qthread.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index c7a6dc8f1a..2072e22340 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -42,6 +42,7 @@
#define QTHREAD_H
#include <QtCore/qobject.h>
+#include <QtCore/qdeadlinetimer.h>
// For QThread::create. The configure-time test just checks for the availability
// of std::future and std::async; for the C++17 codepath we perform some extra
@@ -57,8 +58,6 @@
# endif
#endif
-#include <limits.h>
-
QT_BEGIN_NAMESPACE
@@ -135,8 +134,9 @@ public Q_SLOTS:
void quit();
public:
- // default argument causes thread to block indefinetely
- bool wait(unsigned long time = ULONG_MAX);
+ bool wait(QDeadlineTimer deadline = QDeadlineTimer(QDeadlineTimer::Forever));
+ // ### Qt6 inline this function
+ bool wait(unsigned long time);
static void sleep(unsigned long);
static void msleep(unsigned long);