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
9#include <sys/eventfd.h>
10#include <cstdint>
11
12QT_BEGIN_NAMESPACE
13
14namespace QtPrivate {
15
17 : QObject{
18 parent,
19 },
22 }
23{
24 m_fd = eventfd(/*initval=*/0, EFD_NONBLOCK);
25 if (m_fd == -1) {
26 qCritical() << "eventfd failed:" << qt_error_string(errno);
27 return;
28 }
29
32
33 qt_safe_read(m_fd, &payload, sizeof(payload));
34
36 });
39}
40
46
48{
50
51 constexpr uint64_t increment{ 1 };
52
54 if (bytesWritten == -1)
55 qCritical("QAutoResetEvent::set failed");
56}
57
58} // namespace QtPrivate
59
60QT_END_NAMESPACE
61
62#include "moc_qautoresetevent_linux_p.cpp"