From b81863cfad1ca1e5825eaffb50a9b2fe2da51c7f Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 7 Nov 2019 20:35:32 +0100 Subject: [PATCH] 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 Reviewed-by: Ulf Hermann --- src/corelib/thread/qwaitcondition.h | 21 ++++++++++++++------- 1 file 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 +#include 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)