tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
lock_guard< MutexT > Struct Template Reference

The struct lock_guard is a mutex wrapper that provides a convenient RAII-style mechanism for owning a mutex for the duration of a scoped block. When a lock_guard object is created, it attempts to take ownership of the mutex it is given. When control leaves the scope in which the lock_guard object was created, the lock_guard is destructed and the mutex is released. The lock_guard struct is non-copyable. More...

#include <lock_guard.hpp>

Public Types

using mutex_type = MutexT
 

Public Member Functions

 lock_guard (lock_guard const &)=delete
 
 lock_guard (mutex_type &m)
 
 lock_guard (mutex_type &m, adopt_lock_t)
 
 ~lock_guard ()
 
auto operator= (lock_guard const &) -> lock_guard &=delete
 

Detailed Description

template<typename MutexT>
struct etl::lock_guard< MutexT >

The struct lock_guard is a mutex wrapper that provides a convenient RAII-style mechanism for owning a mutex for the duration of a scoped block. When a lock_guard object is created, it attempts to take ownership of the mutex it is given. When control leaves the scope in which the lock_guard object was created, the lock_guard is destructed and the mutex is released. The lock_guard struct is non-copyable.

Member Typedef Documentation

◆ mutex_type

template<typename MutexT>
using mutex_type = MutexT

Constructor & Destructor Documentation

◆ lock_guard() [1/3]

template<typename MutexT>
lock_guard ( mutex_type & m)
inlineexplicit

◆ lock_guard() [2/3]

template<typename MutexT>
lock_guard ( mutex_type & m,
adopt_lock_t  )
inline

◆ ~lock_guard()

template<typename MutexT>
~lock_guard ( )
inline

◆ lock_guard() [3/3]

template<typename MutexT>
lock_guard ( lock_guard< MutexT > const & )
delete

Member Function Documentation

◆ operator=()

template<typename MutexT>
auto operator= ( lock_guard< MutexT > const & ) -> lock_guard &=delete
delete

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