12#define Q_MUTEX_T void *
13#include <private/qmutex_p.h>
14#include <private/qreadwritelock_p.h>
28 event = CreateEvent(NULL, TRUE, FALSE, NULL);
55 wce->
priority = GetThreadPriority(GetCurrentThread());
79 switch (WaitForSingleObjectEx(wce->
event,
timeout, FALSE)) {
98 ResetEvent(wce->
event);
104 SetEvent(
other->event);
105 other->wokenUp =
true;
122 if (!
d->queue.isEmpty()) {
123 qWarning(
"QWaitCondition: Destroyed while threads are still waiting");
133 if (
time == std::numeric_limits<unsigned long>::max())
146 bool returnValue =
d->wait(wce,
deadline);
149 d->post(wce, returnValue);
156 if (
time == std::numeric_limits<unsigned long>::max())
168 if (previousState == Unlocked)
170 if (previousState == RecursivelyLocked) {
171 qWarning(
"QWaitCondition: cannot wait on QReadWriteLocks with recursive lockForWrite()");
176 readWriteLock->unlock();
178 bool returnValue =
d->wait(wce,
deadline);
180 if (previousState == LockedForWrite)
181 readWriteLock->lockForWrite();
183 readWriteLock->lockForRead();
184 d->post(wce, returnValue);
194 if (current->wokenUp)
196 SetEvent(current->event);
197 current->wokenUp =
true;
207 SetEvent(current->event);
208 current->wokenUp =
true;
bool hasExpired() const noexcept
Returns true if this QDeadlineTimer object has expired, false if there remains time left.
constexpr bool isForever() const noexcept
Returns true if this QDeadlineTimer object never expires, false otherwise.
qint64 remainingTime() const noexcept
Returns the remaining time in this QDeadlineTimer object in milliseconds.
static constexpr ForeverConstant Forever
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
const T & constFirst() const noexcept
void append(parameter_type t)
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
static QReadWriteLockStates::StateForWaitCondition stateForWaitCondition(const QReadWriteLock *lock)
bool wait(QDeadlineTimer deadline)
QWaitConditionEvent * pre()
void post(QWaitConditionEvent *wce, bool ret)
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
GLbitfield GLuint64 timeout
[4]
QList< QWaitConditionEvent * > EventQueue
QDeadlineTimer deadline(30s)