Shaka Player Embedded
Public Member Functions | List of all members
shaka::DebugMutex< _Mutex > Class Template Reference

#include <mutex.h>

Inheritance diagram for shaka::DebugMutex< _Mutex >:
shaka::Waitable

Public Member Functions

 DebugMutex (const std::string &name)
 
 ~DebugMutex () override
 
std::thread::id GetProvider () const override
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
void lock_shared ()
 
bool try_lock_shared ()
 
void unlock_shared ()
 
- Public Member Functions inherited from shaka::Waitable
 Waitable (const std::string &name)
 
virtual ~Waitable ()
 
std::string name () const
 

Detailed Description

template<typename _Mutex>
class shaka::DebugMutex< _Mutex >

A wrapper around a mutex. This exists to provide debug information and to track deadlocks.

This implements the Mutex (and Lockable) concept so it can be used in std::unique_lock<T>. It can also be used in std::condition_variable_any, but it is suggested to use a ThreadEvent instead (to track deadlocks).

If _Mutex implements the SharedMutex concept, so does this.

Definition at line 43 of file mutex.h.

Constructor & Destructor Documentation

§ DebugMutex()

template<typename _Mutex >
shaka::DebugMutex< _Mutex >::DebugMutex ( const std::string &  name)
inlineexplicit

Definition at line 45 of file mutex.h.

§ ~DebugMutex()

template<typename _Mutex >
shaka::DebugMutex< _Mutex >::~DebugMutex ( )
inlineoverride

Definition at line 47 of file mutex.h.

Member Function Documentation

§ GetProvider()

template<typename _Mutex >
std::thread::id shaka::DebugMutex< _Mutex >::GetProvider ( ) const
inlineoverridevirtual
Returns
The thread that will be providing the thing. This can return id() if it is unknown.

Implements shaka::Waitable.

Definition at line 52 of file mutex.h.

§ lock()

template<typename _Mutex >
void shaka::DebugMutex< _Mutex >::lock ( )
inline

Definition at line 56 of file mutex.h.

§ lock_shared()

template<typename _Mutex >
void shaka::DebugMutex< _Mutex >::lock_shared ( )
inline

Definition at line 94 of file mutex.h.

§ try_lock()

template<typename _Mutex >
bool shaka::DebugMutex< _Mutex >::try_lock ( )
inline

Definition at line 72 of file mutex.h.

§ try_lock_shared()

template<typename _Mutex >
bool shaka::DebugMutex< _Mutex >::try_lock_shared ( )
inline

Definition at line 107 of file mutex.h.

§ unlock()

template<typename _Mutex >
void shaka::DebugMutex< _Mutex >::unlock ( )
inline

Definition at line 85 of file mutex.h.

§ unlock_shared()

template<typename _Mutex >
void shaka::DebugMutex< _Mutex >::unlock_shared ( )
inline

Definition at line 120 of file mutex.h.


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