zpp
Zephyr C++20 Framework
|
A userspace mutex class. More...
#include <sys_mutex.hpp>
Public Types | |
using | native_type = struct sys_mutex |
using | native_pointer = native_type * |
using | native_cont_pointer = native_type const * |
Public Member Functions | |
bool | lock () noexcept |
Lock the mutex. Wait for ever until it is locked. More... | |
bool | try_lock () noexcept |
Try locking the mutex without waiting. More... | |
template<class T_Rep , class T_Period > | |
bool | try_lock_for (const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept |
Try locking the mutex with a timeout. More... | |
bool | unlock () noexcept |
Unlock the mutex. More... | |
auto | native_handle () noexcept -> native_pointer |
get the native zephyr mutex handle. More... | |
auto | native_handle () const noexcept -> native_const_pointer |
get the native zephyr mutex handle. More... | |
sys_mutex_base (const sys_mutex_base &)=delete | |
sys_mutex_base (sys_mutex_base &&)=delete | |
sys_mutex_base & | operator= (const sys_mutex_base &)=delete |
sys_mutex_base & | operator= (sys_mutex_base &&)=delete |
Protected Member Functions | |
constexpr | sys_mutex_base () noexcept=default |
Protected default contructor so only derived objects can be created. More... | |
A userspace mutex class.
Definition at line 23 of file sys_mutex.hpp.
using zpp::sys_mutex_base< T_Mutex >::native_cont_pointer = native_type const * |
Definition at line 28 of file sys_mutex.hpp.
using zpp::sys_mutex_base< T_Mutex >::native_pointer = native_type* |
Definition at line 27 of file sys_mutex.hpp.
using zpp::sys_mutex_base< T_Mutex >::native_type = struct sys_mutex |
Definition at line 26 of file sys_mutex.hpp.
|
constexprprotecteddefaultnoexcept |
Protected default contructor so only derived objects can be created.
|
delete |
|
delete |
|
inlinenoexcept |
Lock the mutex. Wait for ever until it is locked.
Definition at line 41 of file sys_mutex.hpp.
References zpp::sys_mutex_base< T_Mutex >::native_handle().
|
inlinenoexcept |
get the native zephyr mutex handle.
Definition at line 112 of file sys_mutex.hpp.
References zpp::sys_mutex_base< T_Mutex >::native_handle().
|
inlinenoexcept |
get the native zephyr mutex handle.
Definition at line 102 of file sys_mutex.hpp.
Referenced by zpp::sys_mutex_base< T_Mutex >::lock(), zpp::sys_mutex_base< T_Mutex >::native_handle(), zpp::sys_mutex_base< T_Mutex >::try_lock(), zpp::sys_mutex_base< T_Mutex >::try_lock_for(), and zpp::sys_mutex_base< T_Mutex >::unlock().
|
delete |
|
delete |
|
inlinenoexcept |
Try locking the mutex without waiting.
Definition at line 55 of file sys_mutex.hpp.
References zpp::sys_mutex_base< T_Mutex >::native_handle().
|
inlinenoexcept |
Try locking the mutex with a timeout.
timeout | The time to wait before returning |
Definition at line 73 of file sys_mutex.hpp.
References zpp::sys_mutex_base< T_Mutex >::native_handle(), and zpp::to_timeout().
|
inlinenoexcept |
Unlock the mutex.
Definition at line 88 of file sys_mutex.hpp.
References zpp::sys_mutex_base< T_Mutex >::native_handle().