OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Catalog_Namespace::read_lock< T > Class Template Reference

#include <RWLocks.h>

Public Member Functions

 read_lock (const T *cat)
 
 ~read_lock ()
 

Private Member Functions

template<typename inner_type >
void lock_catalog (const inner_type *cat)
 

Private Attributes

const T * catalog
 
mapd_shared_lock
< mapd_shared_mutex
lock
 
bool holds_lock
 

Detailed Description

template<typename T>
class Catalog_Namespace::read_lock< T >

Definition at line 37 of file RWLocks.h.

Constructor & Destructor Documentation

template<typename T >
Catalog_Namespace::read_lock< T >::read_lock ( const T *  cat)
inline

Definition at line 54 of file RWLocks.h.

References Catalog_Namespace::read_lock< T >::lock_catalog().

54 : catalog(cat), holds_lock(false) { lock_catalog(cat); }
void lock_catalog(const inner_type *cat)
Definition: RWLocks.h:43

+ Here is the call graph for this function:

template<typename T >
Catalog_Namespace::read_lock< T >::~read_lock ( )
inline

Definition at line 56 of file RWLocks.h.

References Catalog_Namespace::read_lock< T >::holds_lock.

56  {
57  if (holds_lock) {
58  T::thread_holds_read_lock = false;
59  }
60  }

Member Function Documentation

template<typename T >
template<typename inner_type >
void Catalog_Namespace::read_lock< T >::lock_catalog ( const inner_type *  cat)
inlineprivate

Definition at line 43 of file RWLocks.h.

References Catalog_Namespace::read_lock< T >::holds_lock, and Catalog_Namespace::read_lock< T >::lock.

Referenced by Catalog_Namespace::read_lock< T >::read_lock().

43  {
44  std::thread::id tid = std::this_thread::get_id();
45 
46  if (cat->thread_holding_write_lock != tid && !inner_type::thread_holds_read_lock) {
47  lock = mapd_shared_lock<mapd_shared_mutex>(cat->sharedMutex_);
48  inner_type::thread_holds_read_lock = true;
49  holds_lock = true;
50  }
51  }
mapd_shared_lock< mapd_shared_mutex > lock
Definition: RWLocks.h:39

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T >
const T* Catalog_Namespace::read_lock< T >::catalog
private

Definition at line 38 of file RWLocks.h.

template<typename T >
bool Catalog_Namespace::read_lock< T >::holds_lock
private
template<typename T >
mapd_shared_lock<mapd_shared_mutex> Catalog_Namespace::read_lock< T >::lock
private

Definition at line 39 of file RWLocks.h.

Referenced by Catalog_Namespace::read_lock< T >::lock_catalog().


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