Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
XbmcThreads::SharedLock< L > Class Template Reference

#include <Lockables.h>

Protected Member Functions

 SharedLock (L &lockable)
 
 ~SharedLock ()
 
bool owns_lock () const
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
L & get_underlying ()
 

Protected Attributes

L & mutex
 
bool owns
 

Detailed Description

template<typename L>
class XbmcThreads::SharedLock< L >

This template can be used to define the base implementation for any SharedLock (such as CSharedLock) that uses a Shared Lockable as its mutex/critical section.

Something that implements the "Shared Lockable" concept has all of the methods required by the Lockable concept and also:

void lock_shared(); bool try_lock_shared(); void unlock_shared();

Constructor & Destructor Documentation

◆ SharedLock()

template<typename L >
XbmcThreads::SharedLock< L >::SharedLock ( L &  lockable)
inlineexplicitprotected

◆ ~SharedLock()

template<typename L >
XbmcThreads::SharedLock< L >::~SharedLock ( )
inlineprotected

Member Function Documentation

◆ get_underlying()

template<typename L >
L & XbmcThreads::SharedLock< L >::get_underlying ( )
inlineprotected

See the note on the same method on CountingLockable

◆ lock()

template<typename L >
void XbmcThreads::SharedLock< L >::lock ( )
inlineprotected

◆ owns_lock()

template<typename L >
bool XbmcThreads::SharedLock< L >::owns_lock ( ) const
inlineprotected

◆ try_lock()

template<typename L >
bool XbmcThreads::SharedLock< L >::try_lock ( )
inlineprotected

◆ unlock()

template<typename L >
void XbmcThreads::SharedLock< L >::unlock ( )
inlineprotected

Member Data Documentation

◆ mutex

template<typename L >
L& XbmcThreads::SharedLock< L >::mutex
protected

◆ owns

template<typename L >
bool XbmcThreads::SharedLock< L >::owns
protected

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