~aleteoryx/muditaos

ref: 73ef0f9566d86f7cde6c45a9a7ef27664b9dac87 muditaos/module-os/LockGuard.hpp -rw-r--r-- 556 bytes
73ef0f95 — Lefucjusz Revert "[MOS-195] Phone number input style unification" 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <mutex.hpp>

class LockGuard
{
public:
    explicit LockGuard(cpp_freertos::MutexStandard& mutex);
    ~LockGuard();
    LockGuard(const LockGuard &) = delete;
    LockGuard(LockGuard &&)      = delete;

    LockGuard &operator=(const LockGuard &) = delete;
    LockGuard &operator=(LockGuard &&) = delete;

private:
    BaseType_t savedInterruptStatus;
    cpp_freertos::MutexStandard &mutex;
};