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// Qt-Security score:significant reason:default
4
5#ifndef QWAITCONDITION_P_H
6#define QWAITCONDITION_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience of
13// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/QWaitCondition>
20#include <QtCore/QMutex>
21#include <QtCore/QDeadlineTimer>
22#include <QtCore/private/qglobal_p.h>
23
24#include <condition_variable>
25#include <mutex>
26
27QT_BEGIN_NAMESPACE
28
29namespace QtPrivate {
30// Ideal alignment for mutex and condition_variable: it's the hardware
31// interference size (size of a cache line) if the types are likely to contain
32// the actual data structures, otherwise just that of a pointer.
33inline constexpr quintptr IdealMutexAlignment =
34 sizeof(std::mutex) > sizeof(void *) &&
35 sizeof(std::condition_variable) > sizeof(void *) ?
36 64 : alignof(void*);
37
38} // namespace QtPrivate
39
40QT_END_NAMESPACE
41
42#endif /* QWAITCONDITION_P_H */
constexpr bool futexAvailable()
Definition qfutex_p.h:25
void futexWakeAll(Atomic &)
Definition qfutex_p.h:31
bool futexWait(Atomic &, typename Atomic::Type, QDeadlineTimer={})
Definition qfutex_p.h:27
void futexWakeOne(Atomic &)
Definition qfutex_p.h:29
Q_ATOMICWAIT_EXPORT void _q_atomicWake(void *address, WakeMode) noexcept
constexpr quintptr IdealMutexAlignment
Q_ATOMICWAIT_EXPORT void _q_atomicWait(const void *address, const void *old, qsizetype size) noexcept
static bool isEqual(const void *address, const void *old)
static bool isEqual(const void *address, const void *old, qsizetype size) noexcept
static void checkFutexUse()
static QAtomicWaitLocks & atomicLocks() noexcept
#define Q_ATOMICWAIT_EXPORT
std::array< Lock, LockCount > locks
Lock & lockFor(const void *ptr)