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_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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QFUTEX_WIN_P_H
6
#
define
QFUTEX_WIN_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
<
private
/
qglobal_p
.
h
>
20
#
include
<
qdeadlinetimer
.
h
>
21
#
include
<
qtsan_impl
.
h
>
22
23
#
include
<
qt_windows
.
h
>
24
25
#
define
QT_ALWAYS_USE_FUTEX
26
27
QT_BEGIN_NAMESPACE
28
29
namespace
QtWindowsFutex
{
30
constexpr
inline
bool
futexAvailable
() {
return
true
; }
31
32
template
<
typename
Atomic>
33
inline
void
futexWait
(Atomic &futex,
typename
Atomic::Type expectedValue)
34
{
35
QtTsan
::
futexRelease
(
&futex
)
;
36
WaitOnAddress(&futex, &expectedValue,
sizeof
(expectedValue), INFINITE);
37
QtTsan
::
futexAcquire
(
&futex
)
;
38
}
39
template
<
typename
Atomic>
40
inline
bool
futexWait
(Atomic &futex,
typename
Atomic::Type expectedValue, QDeadlineTimer deadline)
41
{
42
using
namespace
std
::chrono;
43
BOOL r = WaitOnAddress(&futex, &expectedValue,
sizeof
(expectedValue), DWORD(deadline.remainingTime()));
44
return
r || GetLastError() != ERROR_TIMEOUT;
45
}
46
template
<
typename
Atomic>
inline
void
futexWakeAll
(Atomic &futex)
47
{
48
WakeByAddressAll(&futex);
49
}
50
template
<
typename
Atomic>
inline
void
futexWakeOne
(Atomic &futex)
51
{
52
WakeByAddressSingle(&futex);
53
}
54
}
// namespace QtWindowsFutex
55
namespace
QtFutex =
QtWindowsFutex
;
56
57
QT_END_NAMESPACE
58
59
#
endif
// QFUTEX_WIN_P_H
QPlatformGraphicsBufferHelper
\inmodule QtGui
QtTsan
Definition
qtsan_impl.h:18
QtTsan::futexRelease
void futexRelease(void *, void *=nullptr)
Definition
qtsan_impl.h:75
QtTsan::futexAcquire
void futexAcquire(void *, void *=nullptr)
Definition
qtsan_impl.h:74
QtWindowsFutex
Definition
qfutex_win_p.h:29
QtWindowsFutex::futexWakeOne
void futexWakeOne(Atomic &futex)
Definition
qfutex_win_p.h:50
QtWindowsFutex::futexWait
void futexWait(Atomic &futex, typename Atomic::Type expectedValue)
Definition
qfutex_win_p.h:33
QtWindowsFutex::futexWakeAll
void futexWakeAll(Atomic &futex)
Definition
qfutex_win_p.h:46
QtWindowsFutex::futexAvailable
constexpr bool futexAvailable()
Definition
qfutex_win_p.h:30
QtWindowsFutex::futexWait
bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, QDeadlineTimer deadline)
Definition
qfutex_win_p.h:40
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtbase
src
corelib
thread
qfutex_win_p.h
Generated on
for Qt by
1.14.0