Lock Challenge Step 4
Syncmultiplethreadssharingaresource
Public Types | Public Member Functions | Private Attributes | List of all members
chal::LockGuard< _Mutex > Class Template Reference

A movable scoped lock type. More...

#include <LockGuard.h>

Public Types

typedef _Mutex mutex_type
 

Public Member Functions

 LockGuard (mutex_type &__m)
 
 LockGuard (mutex_type &__m, std::adopt_lock_t)
 
 ~LockGuard ()
 
 LockGuard (const LockGuard &)=delete
 
LockGuardoperator= (const LockGuard &)=delete
 

Private Attributes

mutex_type_M_device
 

Detailed Description

template<typename _Mutex>
class chal::LockGuard< _Mutex >

A movable scoped lock type.

Note
This class has been kept as identical to std::lock_guard as possible

A unique_lock controls mutex ownership within a scope. Ownership of the mutex can be delayed until after construction and can be transferred to another unique_lock by move construction or move assignment. If a mutex lock is owned when the destructor runs ownership will be released.< returns type determined by calling function

Definition at line 34 of file LockGuard.h.

Member Typedef Documentation

◆ mutex_type

template<typename _Mutex>
typedef _Mutex chal::LockGuard< _Mutex >::mutex_type

Definition at line 37 of file LockGuard.h.

Constructor & Destructor Documentation

◆ LockGuard() [1/3]

template<typename _Mutex>
chal::LockGuard< _Mutex >::LockGuard ( mutex_type __m)
inlineexplicit

Definition at line 41 of file LockGuard.h.

◆ LockGuard() [2/3]

template<typename _Mutex>
chal::LockGuard< _Mutex >::LockGuard ( mutex_type __m,
std::adopt_lock_t   
)
inline

Definition at line 51 of file LockGuard.h.

◆ ~LockGuard()

template<typename _Mutex>
chal::LockGuard< _Mutex >::~LockGuard ( )
inline

Definition at line 59 of file LockGuard.h.

◆ LockGuard() [3/3]

template<typename _Mutex>
chal::LockGuard< _Mutex >::LockGuard ( const LockGuard< _Mutex > &  )
delete

Member Function Documentation

◆ operator=()

template<typename _Mutex>
LockGuard& chal::LockGuard< _Mutex >::operator= ( const LockGuard< _Mutex > &  )
delete

Member Data Documentation

◆ _M_device

template<typename _Mutex>
mutex_type& chal::LockGuard< _Mutex >::_M_device
private

Definition at line 73 of file LockGuard.h.


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