Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaitcondition_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QWAITCONDITION_P_H
4#define QWAITCONDITION_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists for the convenience of
11// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtCore/QWaitCondition>
18#include <QtCore/QMutex>
19#include <QtCore/QDeadlineTimer>
20#include <QtCore/private/qglobal_p.h>
21
22#include <condition_variable>
23#include <mutex>
24
25QT_BEGIN_NAMESPACE
26
27namespace QtPrivate {
28// Ideal alignment for mutex and condition_variable: it's the hardware
29// interference size (size of a cache line) if the types are likely to contain
30// the actual data structures, otherwise just that of a pointer.
31inline constexpr quintptr IdealMutexAlignment =
32 sizeof(std::mutex) > sizeof(void *) &&
33 sizeof(std::condition_variable) > sizeof(void *) ?
34 64 : alignof(void*);
35
36} // namespace QtPrivate
37
38QT_END_NAMESPACE
39
40#endif /* QWAITCONDITION_P_H */
QSemaphorePrivate(qsizetype n)
Combined button and popup list for selecting options.
Lock qt_scoped_lock(Mutex &mutex)
Definition qlocking_p.h:58
Lock qt_unique_lock(Mutex &mutex)
Definition qlocking_p.h:64
Lock qt_unique_lock(Mutex *mutex)
Definition qlocking_p.h:70
constexpr quintptr IdealMutexAlignment
static constexpr bool futexHasWaiterCount
static constexpr QDeadlineTimer::ForeverConstant Expired
static QBasicAtomicInteger< quint32 > * futexHigh32(QBasicAtomicInteger< quintptr > *ptr)
static constexpr quintptr futexNeedsWakeAllBit
static QBasicAtomicInteger< quint32 > * futexLow32(QBasicAtomicInteger< quintptr > *ptr)
bool futexSemaphoreTryAcquire_loop(QBasicAtomicInteger< quintptr > &u, quintptr curValue, quintptr nn, QDeadlineTimer timer)
static bool futexNeedsWake(quintptr v)
static int futexAvailCounter(quintptr v)
bool futexSemaphoreTryAcquire(QBasicAtomicInteger< quintptr > &u, int n, T timeout)
std::condition_variable cond
std::condition_variable cond