Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QWAITCONDITION_H
6
#
define
QWAITCONDITION_H
7
8
#
include
<
QtCore
/
QDeadlineTimer
>
9
10
QT_BEGIN_NAMESPACE
11
12
#
if
QT_CONFIG
(
thread
)
13
14
class
QWaitConditionPrivate;
15
class
QMutex;
16
class
QReadWriteLock;
17
18
class
Q_CORE_EXPORT QWaitCondition
19
{
20
public
:
21
QWaitCondition();
22
~QWaitCondition();
23
24
bool
wait(QMutex *lockedMutex,
25
QDeadlineTimer deadline = QDeadlineTimer(QDeadlineTimer::Forever));
26
bool
wait(QMutex *lockedMutex,
unsigned
long
time);
27
28
bool
wait(QReadWriteLock *lockedReadWriteLock,
29
QDeadlineTimer deadline = QDeadlineTimer(QDeadlineTimer::Forever));
30
bool
wait(QReadWriteLock *lockedReadWriteLock,
unsigned
long
time);
31
32
void
wakeOne();
33
void
wakeAll();
34
35
void
notify_one() { wakeOne(); }
36
void
notify_all() { wakeAll(); }
37
38
private
:
39
Q_DISABLE_COPY(QWaitCondition)
40
41
QWaitConditionPrivate *d;
42
};
43
44
#
else
45
46
class
QMutex;
47
class
QReadWriteLock;
48
49
class
Q_CORE_EXPORT
QWaitCondition
50
{
51
public
:
52
QWaitCondition() {}
53
~QWaitCondition() {}
54
55
bool
wait(QMutex *, QDeadlineTimer = QDeadlineTimer(QDeadlineTimer::Forever))
56
{
return
true
; }
57
bool
wait(QReadWriteLock *, QDeadlineTimer = QDeadlineTimer(QDeadlineTimer::Forever))
58
{
return
true
; }
59
bool
wait(QMutex *,
unsigned
long
) {
return
true
; }
60
bool
wait(QReadWriteLock *,
unsigned
long
) {
return
true
; }
61
62
void
wakeOne() {}
63
void
wakeAll() {}
64
65
void
notify_one() { wakeOne(); }
66
void
notify_all() { wakeAll(); }
67
};
68
69
#
endif
// QT_CONFIG(thread)
70
71
QT_END_NAMESPACE
72
73
#
endif
// QWAITCONDITION_H
QWaitConditionPrivate
Definition
qwaitcondition_unix.cpp:48
QWaitConditionPrivate::wait
bool wait(QDeadlineTimer deadline)
Definition
qwaitcondition_unix.cpp:61
QWaitConditionPrivate::mutex
pthread_mutex_t mutex
Definition
qwaitcondition_unix.cpp:50
QWaitConditionPrivate::wakeups
int wakeups
Definition
qwaitcondition_unix.cpp:53
QWaitConditionPrivate::cond
pthread_cond_t cond
Definition
qwaitcondition_unix.cpp:51
QWaitConditionPrivate::waiters
int waiters
Definition
qwaitcondition_unix.cpp:52
QWaitConditionPrivate::wait_relative
int wait_relative(QDeadlineTimer deadline)
Definition
qwaitcondition_unix.cpp:55
QWaitCondition
Definition
qwaitcondition.h:50
qt_initialize_pthread_cond
static void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
Definition
qwaitcondition_unix.cpp:30
qt_report_pthread_error
static QT_BEGIN_NAMESPACE void qt_report_pthread_error(int code, const char *where, const char *what)
Definition
qwaitcondition_unix.cpp:24
qtbase
src
corelib
thread
qwaitcondition.h
Generated on
for Qt by
1.18.0