Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | List of all members
honey::SharedLock< Lockable_ > Class Template Reference

A scoped lock that references a shared mutex. Does a shared read lock on construction and unlocks on destruction. More...

#include <Shared.h>

Inheritance diagram for honey::SharedLock< Lockable_ >:
Inheritance graph
[legend]
Collaboration diagram for honey::SharedLock< Lockable_ >:
Collaboration graph
[legend]

Public Types

typedef Lockable_ Lockable
 

Public Member Functions

 SharedLock ()
 
 SharedLock (Lockable &lock, lock::Op op=lock::Op::lock)
 
template<class Rep , class Period >
 SharedLock (Lockable &lock, Duration< Rep, Period > time)
 
template<class Clock , class Dur >
 SharedLock (Lockable &lock, TimePoint< Clock, Dur > time)
 
 SharedLock (SharedLock &&rhs) noexcept
 
 SharedLock (UniqueLock< Lockable > &&rhs)
 Atomically unlock unique writer lock and acquire shared reader lock without blocking. The unique lock is released. More...
 
 ~SharedLock ()
 
SharedLockoperator= (SharedLock &&rhs)
 
SharedLockoperator= (UniqueLock< Lockable > &&rhs)
 
void lock ()
 
void unlock ()
 
bool tryLock ()
 
template<class Rep , class Period >
bool tryLock (Duration< Rep, Period > time)
 
template<class Clock , class Dur >
bool tryLock (TimePoint< Clock, Dur > time)
 
bool owns () const
 
 operator bool () const
 
Lockablemutex ()
 
Lockablerelease ()
 

Detailed Description

template<class Lockable_>
class honey::SharedLock< Lockable_ >

A scoped lock that references a shared mutex. Does a shared read lock on construction and unlocks on destruction.

Instances are non-recursive (can't lock an instance twice), and can only be manipulated by one thread.
Note that if recursion is required, multiple instances can reference the same recursive lockable.

Member Typedef Documentation

template<class Lockable_ >
typedef Lockable_ honey::SharedLock< Lockable_ >::Lockable

Constructor & Destructor Documentation

template<class Lockable_ >
honey::SharedLock< Lockable_ >::SharedLock ( )
inline
template<class Lockable_ >
honey::SharedLock< Lockable_ >::SharedLock ( Lockable lock,
lock::Op  op = lock::Op::lock 
)
inline
template<class Lockable_ >
template<class Rep , class Period >
honey::SharedLock< Lockable_ >::SharedLock ( Lockable lock,
Duration< Rep, Period >  time 
)
inline
template<class Lockable_ >
template<class Clock , class Dur >
honey::SharedLock< Lockable_ >::SharedLock ( Lockable lock,
TimePoint< Clock, Dur >  time 
)
inline
template<class Lockable_ >
honey::SharedLock< Lockable_ >::SharedLock ( SharedLock< Lockable_ > &&  rhs)
inlinenoexcept
template<class Lockable_ >
honey::SharedLock< Lockable_ >::SharedLock ( UniqueLock< Lockable > &&  rhs)
inline

Atomically unlock unique writer lock and acquire shared reader lock without blocking. The unique lock is released.

template<class Lockable_ >
honey::SharedLock< Lockable_ >::~SharedLock ( )
inline

Member Function Documentation

template<class Lockable_ >
void honey::SharedLock< Lockable_ >::lock ( )
inline
template<class Lockable_ >
Lockable& honey::SharedLock< Lockable_ >::mutex ( )
inline
template<class Lockable_ >
honey::SharedLock< Lockable_ >::operator bool ( ) const
inlineexplicit
template<class Lockable_ >
SharedLock& honey::SharedLock< Lockable_ >::operator= ( SharedLock< Lockable_ > &&  rhs)
inline
template<class Lockable_ >
SharedLock& honey::SharedLock< Lockable_ >::operator= ( UniqueLock< Lockable > &&  rhs)
inline
template<class Lockable_ >
bool honey::SharedLock< Lockable_ >::owns ( ) const
inline
template<class Lockable_ >
Lockable& honey::SharedLock< Lockable_ >::release ( )
inline
template<class Lockable_ >
bool honey::SharedLock< Lockable_ >::tryLock ( )
inline
template<class Lockable_ >
template<class Rep , class Period >
bool honey::SharedLock< Lockable_ >::tryLock ( Duration< Rep, Period >  time)
inline
template<class Lockable_ >
template<class Clock , class Dur >
bool honey::SharedLock< Lockable_ >::tryLock ( TimePoint< Clock, Dur >  time)
inline
template<class Lockable_ >
void honey::SharedLock< Lockable_ >::unlock ( )
inline

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