diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-11-07 20:35:32 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-11-08 20:14:45 +0100 |
commit | b81863cfad1ca1e5825eaffb50a9b2fe2da51c7f (patch) | |
tree | 470a5d5fc5e429731ba3af73e76814e58c956a80 | |
parent | 576c8126ab569020b6396134570190525567e36f (diff) |
QWaitCondition: fix dummy QWaitCondition implementation
The dummy implementation of QWaitCondition which is used when the thread
feature is not available lacks some functions which were recently added.
So we have to add them now.
Change-Id: I32720e0857a1bd3fcf0e70078404a38dd8a8ca88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/corelib/thread/qwaitcondition.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/corelib/thread/qwaitcondition.h b/src/corelib/thread/qwaitcondition.h index 86e2141f84..079049af25 100644 --- a/src/corelib/thread/qwaitcondition.h +++ b/src/corelib/thread/qwaitcondition.h @@ -40,7 +40,7 @@ #ifndef QWAITCONDITION_H #define QWAITCONDITION_H -#include <QDeadlineTimer> +#include <QtCore/QDeadlineTimer> QT_BEGIN_NAMESPACE @@ -82,21 +82,28 @@ private: #else class QMutex; +class QReadWriteLock; + class Q_CORE_EXPORT QWaitCondition { public: QWaitCondition() {} ~QWaitCondition() {} - bool wait(QMutex *mutex, unsigned long time = ULONG_MAX) - { - Q_UNUSED(mutex); - Q_UNUSED(time); - return true; - } + bool wait(QMutex *, QDeadlineTimer = QDeadlineTimer(QDeadlineTimer::Forever)) + { return true; } + bool wait(QReadWriteLock *, QDeadlineTimer = QDeadlineTimer(QDeadlineTimer::Forever)) + { return true; } +#if QT_DEPRECATED_SINCE(5, 15) + bool wait(QMutex *, unsigned long) { return true; } + bool wait(QReadWriteLock *, unsigned long) { return true; } +#endif void wakeOne() {} void wakeAll() {} + + void notify_one() { wakeOne(); } + void notify_all() { wakeAll(); } }; #endif // QT_CONFIG(thread) |