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>
bb10
Christian Ehrlicher 2019-11-07 20:35:32 +01:00
parent 576c8126ab
commit b81863cfad
1 changed files with 14 additions and 7 deletions

View File

@ -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)