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 */
43

source code of qtbase/src/corelib/thread/qwaitcondition_p.h