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
qfutex_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QFUTEX_P_H
6#define QFUTEX_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
13// implementation detail. 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 <qdeadlinetimer.h>
20#include <private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace QtDummyFutex {
25 constexpr inline bool futexAvailable() { return false; }
26 template <typename Atomic>
27 inline bool futexWait(Atomic &, typename Atomic::Type, QDeadlineTimer = {})
28 { Q_UNREACHABLE_RETURN(false); }
29 template <typename Atomic> inline void futexWakeOne(Atomic &)
30 { Q_UNREACHABLE(); }
31 template <typename Atomic> inline void futexWakeAll(Atomic &)
32 { Q_UNREACHABLE(); }
33}
34
36
37#if defined(Q_OS_DARWIN)
38# include "qfutex_mac_p.h"
39#elif defined(Q_OS_FREEBSD)
40# include "qfutex_freebsd_p.h"
41#elif defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
42// use Linux mutexes everywhere except for LSB builds
43# include "qfutex_linux_p.h"
44#elif defined(Q_OS_WIN)
45# include "qfutex_win_p.h"
46#else
48namespace QtFutex = QtDummyFutex;
49QT_END_NAMESPACE
50#endif
51
52#endif // QFUTEX_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
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)