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
qautoresetevent_linux.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QtMultimedia/private/qtmm_rtsan_support_p.h>
7#include <QtCore/private/qcore_unix_p.h>
8#include <QtCore/qdebug.h>
9
10#include <sys/eventfd.h>
11#include <cstdint>
12
13QT_BEGIN_NAMESPACE
14
15namespace QtPrivate {
16
18 : QObject{
19 parent,
20 },
21 m_fd{
22 eventfd(/*initval=*/0, EFD_NONBLOCK),
23 },
26 this,
27 }
28{
29 if (!isValid()) {
30 qCritical() << "eventfd failed:" << qt_error_string(errno);
31 return;
32 }
33
36
37 std::ignore = qt_safe_read(m_fd.get(), &payload, sizeof(payload));
38
40 });
43}
44
46{
48
49 constexpr uint64_t increment{ 1 };
50
51 ScopedRTSanDisabler disabler; // opened via EFD_NONBLOCK
53 if (bytesWritten == -1)
54 qCritical("QAutoResetEvent::set failed");
55}
56
57} // namespace QtPrivate
58
59QT_END_NAMESPACE
60
61#include "moc_qautoresetevent_linux_p.cpp"