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
qatomicwait_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 Intel Corporation.
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 QATOMICWAIT_P_H
6#define QATOMICWAIT_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 purely as an implementation
13// detail. This header file may change from version to version without notice,
14// or even be removed.
15//
16// We mean it.
17//
18
19#include "qbasicatomic.h"
20#include <private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace QtPrivate {
25enum class WakeMode { One = 1, All = -1 };
26
27#ifdef QATOMICWAIT_USE_FALLBACK
28# define Q_ATOMICWAIT_EXPORT /* being linked into the unit test */
29#else
30# define Q_ATOMICWAIT_EXPORT Q_CORE_EXPORT
31#endif
32
33Q_ATOMICWAIT_EXPORT void _q_atomicWait(const void *address, const void *old, qsizetype size) noexcept;
34Q_ATOMICWAIT_EXPORT void _q_atomicWake(void *address, WakeMode) noexcept;
35
36#undef Q_ATOMICWAIT_EXPORT
37}
38
68
69namespace q20 {
70#ifdef __cpp_lib_atomic_wait
71using std::atomic_wait;
75#else
76using QtFallbackAtomicWait::atomic_wait;
77using QtFallbackAtomicWait::atomic_wait_explicit;
78using QtFallbackAtomicWait::atomic_notify_all;
79using QtFallbackAtomicWait::atomic_notify_one;
80#endif
81} // namespace QtNativeAtomicWait
82
83QT_END_NAMESPACE
84
85#endif // QATOMICWAIT_P_H
constexpr bool futexAvailable()
Definition qfutex_p.h:25
Q_ATOMICWAIT_EXPORT void _q_atomicWake(void *address, WakeMode) noexcept
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)