Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaitcondition.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWAITCONDITION_H
5#define QWAITCONDITION_H
6
7#include <QtCore/QDeadlineTimer>
8
10
11#if QT_CONFIG(thread)
12
14class QMutex;
15class QReadWriteLock;
16
17class Q_CORE_EXPORT QWaitCondition
18{
19public:
22
23 bool wait(QMutex *lockedMutex,
25 bool wait(QMutex *lockedMutex, unsigned long time);
26
27 bool wait(QReadWriteLock *lockedReadWriteLock,
29 bool wait(QReadWriteLock *lockedReadWriteLock, unsigned long time);
30
31 void wakeOne();
32 void wakeAll();
33
34 void notify_one() { wakeOne(); }
35 void notify_all() { wakeAll(); }
36
37private:
38 Q_DISABLE_COPY(QWaitCondition)
39
41};
42
43#else
44
45class QMutex;
46class QReadWriteLock;
47
48class Q_CORE_EXPORT QWaitCondition
49{
50public:
53
58 bool wait(QMutex *, unsigned long) { return true; }
59 bool wait(QReadWriteLock *, unsigned long) { return true; }
60
61 void wakeOne() {}
62 void wakeAll() {}
63
64 void notify_one() { wakeOne(); }
65 void notify_all() { wakeAll(); }
66};
67
68#endif // QT_CONFIG(thread)
69
71
72#endif // QWAITCONDITION_H
\inmodule QtCore
static constexpr ForeverConstant Forever
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
bool wait(QReadWriteLock *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
bool wait(QReadWriteLock *, unsigned long)
bool wait(QMutex *, unsigned long)
Combined button and popup list for selecting options.
QDeadlineTimer deadline(30s)
keyPressed wakeAll()