LMMS
Loading...
Searching...
No Matches
SystemSemaphore.h
Go to the documentation of this file.
1/*
2 * SystemSemaphore.h
3 *
4 * Copyright (c) 2024 Dominic Clark
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 */
23
24#ifndef LMMS_SYSTEM_SEMAPHORE_H
25#define LMMS_SYSTEM_SEMAPHORE_H
26
27#include <memory>
28#include <string>
29
30namespace lmms {
31
32namespace detail {
33
34class SystemSemaphoreImpl;
35
36} // namespace detail
37
39{
40public:
42 SystemSemaphore(std::string key, unsigned int value);
43 explicit SystemSemaphore(std::string key);
45
47 auto operator=(SystemSemaphore&& other) noexcept -> SystemSemaphore&;
48
49 auto acquire() noexcept -> bool;
50 auto release() noexcept -> bool;
51
52 auto key() const noexcept -> const std::string& { return m_key; }
53
54private:
55 std::string m_key;
56 std::unique_ptr<detail::SystemSemaphoreImpl> m_impl;
57};
58
59} // namespace lmms
60
61#endif // LMMS_SYSTEM_SEMAPHORE_H
#define noexcept
Definition DistrhoDefines.h:72
auto key() const noexcept -> const std::string &
Definition SystemSemaphore.h:52
SystemSemaphore() noexcept
std::string m_key
Definition SystemSemaphore.h:55
std::unique_ptr< detail::SystemSemaphoreImpl > m_impl
Definition SystemSemaphore.h:56
auto release() noexcept -> bool
auto acquire() noexcept -> bool
static PuglViewHint int value
Definition pugl.h:1708
Definition AudioBufferView.h:45
Definition AudioAlsa.cpp:35
Definition juce_Uuid.h:141
#define const
Definition zconf.h:137