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
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
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QtTsan
Definition
qtsan_impl.h:17
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
QtWindowsFutex::futexWait
bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, QDeadlineTimer deadline)
Definition
qfutex_win_p.h:39
std
Definition
qfloat16.h:493
qtbase
src
corelib
thread
qfutex_win_p.h
Generated on Mon Mar 10 2025 01:10:21 for Qt by
1.13.2