zpp
Zephyr C++20 Framework
zpp::sys_mutex Class Reference

A recursive mutex class. More...

#include <sys_mutex.hpp>

Inheritance diagram for zpp::sys_mutex:
[legend]
Collaboration diagram for zpp::sys_mutex:
[legend]

Public Member Functions

 sys_mutex () noexcept
 Default constructor. More...
 
constexpr auto native_handle () noexcept -> native_pointer
 get the native zephyr mutex handle. More...
 
constexpr auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr mutex handle. More...
 
 sys_mutex (const sys_mutex &)=delete
 
 sys_mutex (sys_mutex &&)=delete
 
sys_mutexoperator= (const sys_mutex &)=delete
 
sys_mutexoperator= (sys_mutex &&)=delete
 
- Public Member Functions inherited from zpp::sys_mutex_base< sys_mutex >
 sys_mutex_base (const sys_mutex_base &)=delete
 
 sys_mutex_base (sys_mutex_base &&)=delete
 
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...
 
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_baseoperator= (const sys_mutex_base &)=delete
 
sys_mutex_baseoperator= (sys_mutex_base &&)=delete
 

Additional Inherited Members

- Public Types inherited from zpp::sys_mutex_base< sys_mutex >
using native_type = struct sys_mutex
 
using native_pointer = native_type *
 
using native_cont_pointer = native_type const *
 
- Protected Member Functions inherited from zpp::sys_mutex_base< sys_mutex >
constexpr sys_mutex_base () noexcept=default
 Protected default contructor so only derived objects can be created. More...
 

Detailed Description

A recursive mutex class.

Definition at line 126 of file sys_mutex.hpp.

Constructor & Destructor Documentation

◆ sys_mutex() [1/3]

zpp::sys_mutex::sys_mutex ( )
inlinenoexcept

Default constructor.

Definition at line 131 of file sys_mutex.hpp.

132  {
133  sys_mutex_init(&m_mutex);
134  }

◆ sys_mutex() [2/3]

zpp::sys_mutex::sys_mutex ( const sys_mutex )
delete

◆ sys_mutex() [3/3]

zpp::sys_mutex::sys_mutex ( sys_mutex &&  )
delete

Member Function Documentation

◆ native_handle() [1/2]

constexpr auto zpp::sys_mutex::native_handle ( ) const -> native_const_pointer
inlineconstexprnoexcept

get the native zephyr mutex handle.

Returns
A pointer to the zephyr sys_mutex.

Definition at line 151 of file sys_mutex.hpp.

152  {
153  return &m_mutex;
154  }

◆ native_handle() [2/2]

constexpr auto zpp::sys_mutex::native_handle ( ) -> native_pointer
inlineconstexprnoexcept

get the native zephyr mutex handle.

Returns
A pointer to the zephyr sys_mutex.

Definition at line 141 of file sys_mutex.hpp.

142  {
143  return &m_mutex;
144  }

◆ operator=() [1/2]

sys_mutex& zpp::sys_mutex::operator= ( const sys_mutex )
delete

◆ operator=() [2/2]

sys_mutex& zpp::sys_mutex::operator= ( sys_mutex &&  )
delete

The documentation for this class was generated from the following file: