ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
freertos_mutex.hpp
Go to the documentation of this file.
1
5#ifndef ELEC_C7222_UTILS_FREERTOS_MUTEX_HPP
6#define ELEC_C7222_UTILS_FREERTOS_MUTEX_HPP
7
8#include <cstdint>
9
10#include "non_copyable.hpp"
11
12namespace c7222 {
13
32 public:
36 bool Initialize();
39
45 bool Lock(std::uint32_t ticks_to_wait = 0);
47 bool TryLock();
49 bool Unlock();
51 bool IsValid() const;
52
53 private:
54 void* handle_{nullptr};
55};
56
76 public:
80 bool Initialize();
83
89 bool Lock(std::uint32_t ticks_to_wait = 0);
91 bool TryLock();
93 bool Unlock();
95 bool IsValid() const;
96
97 private:
98 void* handle_{nullptr};
99};
100
101} // namespace c7222
102
103#endif // ELEC_C7222_UTILS_FREERTOS_MUTEX_HPP
Ownership-based wrapper for a standard mutex with destructor cleanup.
Definition freertos_mutex.hpp:31
bool Initialize()
Initialize (or re-initialize) the mutex.
bool Lock(std::uint32_t ticks_to_wait=0)
Acquire the mutex.
FreeRtosMutex()
Construct and initialize a mutex.
~FreeRtosMutex()
Destroy mutex resources if initialized.
bool IsValid() const
bool Unlock()
Release the mutex.
bool TryLock()
Non-blocking lock attempt.
Ownership-based wrapper for a recursive mutex with destructor cleanup.
Definition freertos_mutex.hpp:75
bool Lock(std::uint32_t ticks_to_wait=0)
Acquire the recursive mutex.
bool TryLock()
Non-blocking lock attempt.
bool Initialize()
Initialize (or re-initialize) the recursive mutex.
~FreeRtosRecursiveMutex()
Destroy recursive mutex resources if initialized.
bool Unlock()
Release one recursion level.
FreeRtosRecursiveMutex()
Construct and initialize a recursive mutex.
Disable both copy and move operations.
Definition non_copyable.hpp:75
C7222 course abstractions namespace.
Definition ble.hpp:20
Base classes to control copy/move semantics.