LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
LogCabin::Core::HoldingMutex Class Reference

Proof that the caller is holding some mutex. More...

#include <Mutex.h>

List of all members.

Public Member Functions

template<typename Mutex >
 HoldingMutex (const std::lock_guard< Mutex > &lockGuard)
 Constructor from std::lock_guard.
template<typename Mutex >
 HoldingMutex (const std::unique_lock< Mutex > &lockGuard)
 Constructor from std::unique_lock.

Detailed Description

Proof that the caller is holding some mutex.

Useful as an additional (unused) argument for some private methods that want to ensure the caller is holding a lock.

Definition at line 116 of file Mutex.h.


Constructor & Destructor Documentation

template<typename Mutex >
LogCabin::Core::HoldingMutex::HoldingMutex ( const std::lock_guard< Mutex > &  lockGuard) [inline, explicit]

Constructor from std::lock_guard.

Definition at line 122 of file Mutex.h.

template<typename Mutex >
LogCabin::Core::HoldingMutex::HoldingMutex ( const std::unique_lock< Mutex > &  lockGuard) [inline, explicit]

Constructor from std::unique_lock.

Since unique_lock might not, in fact, hold the lock, this uses a dynamic check in the form of an assert().

Definition at line 130 of file Mutex.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines