Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qfutex_win_p.h
Go to the documentation of this file.
1
// Copyright (C) 2023 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
4
#ifndef QFUTEX_WIN_P_H
5
#define QFUTEX_WIN_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#include <private/qglobal_p.h>
19
#include <
qdeadlinetimer.h
>
20
#include <
qtsan_impl.h
>
21
22
#include <
qt_windows.h
>
23
24
#define QT_ALWAYS_USE_FUTEX
25
26
QT_BEGIN_NAMESPACE
27
28
namespace
QtWindowsFutex
{
29
constexpr
inline
bool
futexAvailable
() {
return
true
; }
30
31
template
<
typename
Atomic>
32
inline
void
futexWait
(Atomic &futex,
typename
Atomic::Type expectedValue)
33
{
34
QtTsan::futexRelease
(&futex);
35
WaitOnAddress(&futex, &expectedValue,
sizeof
(expectedValue), INFINITE);
36
QtTsan::futexAcquire
(&futex);
37
}
38
template
<
typename
Atomic>
39
inline
bool
futexWait
(Atomic &futex,
typename
Atomic::Type expectedValue,
QDeadlineTimer
deadline
)
40
{
41
using namespace
std::chrono;
42
BOOL
r
= WaitOnAddress(&futex, &expectedValue,
sizeof
(expectedValue), DWORD(
deadline
.
remainingTime
()));
43
return
r
|| GetLastError() != ERROR_TIMEOUT;
44
}
45
template
<
typename
Atomic>
inline
void
futexWakeAll
(Atomic &futex)
46
{
47
WakeByAddressAll(&futex);
48
}
49
template
<
typename
Atomic>
inline
void
futexWakeOne
(Atomic &futex)
50
{
51
WakeByAddressSingle(&futex);
52
}
53
}
// namespace QtWindowsFutex
54
namespace
QtFutex
=
QtWindowsFutex
;
55
56
QT_END_NAMESPACE
57
58
#endif
// QFUTEX_WIN_P_H
QDeadlineTimer
\inmodule QtCore
Definition
qdeadlinetimer.h:23
QDeadlineTimer::remainingTime
qint64 remainingTime() const noexcept
Returns the remaining time in this QDeadlineTimer object in milliseconds.
Definition
qdeadlinetimer.cpp:412
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
QtFreeBSDFutex
Definition
qfutex_freebsd_p.h:28
QtTsan::futexRelease
void futexRelease(void *, void *=nullptr)
Definition
qtsan_impl.h:63
QtTsan::futexAcquire
void futexAcquire(void *, void *=nullptr)
Definition
qtsan_impl.h:62
QtWindowsFutex
Definition
qfutex_win_p.h:28
QtWindowsFutex::futexWakeOne
void futexWakeOne(Atomic &futex)
Definition
qfutex_win_p.h:49
QtWindowsFutex::futexWait
void futexWait(Atomic &futex, typename Atomic::Type expectedValue)
Definition
qfutex_win_p.h:32
QtWindowsFutex::futexWakeAll
void futexWakeAll(Atomic &futex)
Definition
qfutex_win_p.h:45
QtWindowsFutex::futexAvailable
constexpr bool futexAvailable()
Definition
qfutex_win_p.h:29
qdeadlinetimer.h
r
GLboolean r
[2]
Definition
qopengles2ext.h:337
qt_windows.h
qtsan_impl.h
deadline
QDeadlineTimer deadline(30s)
qtbase
src
corelib
thread
qfutex_win_p.h
Generated by
1.10.0