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
qsystemsemaphore.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5#ifndef QSYSTEMSEMAPHORE_H
6#define QSYSTEMSEMAPHORE_H
7
8#include <QtCore/qcoreapplication.h>
9#include <QtCore/qtipccommon.h>
10#include <QtCore/qstring.h>
11#include <QtCore/qscopedpointer.h>
12
13#include <memory>
14
16
17#if QT_CONFIG(systemsemaphore)
18
20
22{
25public:
26 enum AccessMode
27 {
28 Open,
29 Create
30 };
32
34 {
35 NoError,
42 };
43
46
48 void setNativeKey(const QString &key, int initialValue = 0, AccessMode mode = Open,
52
54 void setKey(const QString &key, int initialValue = 0, AccessMode mode = Open);
55 QString key() const;
56
57 bool acquire();
58 bool release(int n = 1);
59
61 QString errorString() const;
62
68
69private:
72};
73
74#endif // QT_CONFIG(systemsemaphore)
75
77
78#endif // QSYSTEMSEMAPHORE_H
\inmodule QtSql