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 <QtCore/private/qcore_unix_p.h>
7#include <QtCore/qdebug.h>
8#include <QtMultimedia/private/qaudio_rtsan_support_p.h>
9
10#include <sys/eventfd.h>
11#include <cstdint>
12
13QT_BEGIN_NAMESPACE
14
15namespace QtPrivate {
16
18 : QObject{
19 parent,
20 },
23 }
24{
25 m_fd = eventfd(/*initval=*/0, EFD_NONBLOCK);
26 if (m_fd == -1) {
27 qCritical() << "eventfd failed:" << qt_error_string(errno);
28 return;
29 }
30
33
34 qt_safe_read(m_fd, &payload, sizeof(payload));
35
37 });
40}
41
47
49{
51
52 constexpr uint64_t increment{ 1 };
53
54 ScopedRTSanDisabler disabler; // opened via EFD_NONBLOCK
56 if (bytesWritten == -1)
57 qCritical("QAutoResetEvent::set failed");
58}
59
60} // namespace QtPrivate
61
62QT_END_NAMESPACE
63
64#include "moc_qautoresetevent_linux_p.cpp"