OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
legacylockmgr::LockMgr< MutexType, KeyType > Class Template Reference

#include <LegacyLockMgr.h>

Static Public Member Functions

static std::shared_ptr
< WrapperType< MutexType > > 
getMutex (const LockType lockType, const KeyType &key)
 

Static Private Attributes

static std::mutex aMutex_
 
static std::map< std::tuple
< LockType, KeyType >
, std::shared_ptr< WrapperType
< MutexType > > > 
mutexMap_
 

Detailed Description

template<typename MutexType, typename KeyType>
class legacylockmgr::LockMgr< MutexType, KeyType >

Definition at line 93 of file LegacyLockMgr.h.

Member Function Documentation

template<typename MutexType , typename KeyType >
std::shared_ptr< WrapperType< MutexType > > legacylockmgr::LockMgr< MutexType, KeyType >::getMutex ( const LockType  lockType,
const KeyType &  key 
)
static

Definition at line 111 of file LegacyLockMgr.h.

113  {
114  auto lock_key = std::make_tuple(lock_type, key);
115 
116  std::unique_lock<std::mutex> lck(aMutex_);
117  auto mit = mutexMap_.find(lock_key);
118  if (mit != mutexMap_.end()) {
119  return mit->second;
120  }
121 
122  auto tMutex = std::make_shared<WrapperType<MutexType>>();
123  mutexMap_[lock_key] = tMutex;
124  return tMutex;
125 }
static std::map< std::tuple< LockType, KeyType >, std::shared_ptr< WrapperType< MutexType > > > mutexMap_
static std::mutex aMutex_
Definition: LegacyLockMgr.h:99

Member Data Documentation

template<typename MutexType , typename KeyType >
std::mutex legacylockmgr::LockMgr< MutexType, KeyType >::aMutex_
staticprivate

Definition at line 99 of file LegacyLockMgr.h.

template<typename MutexType , typename KeyType >
std::map< std::tuple< LockType, KeyType >, std::shared_ptr< WrapperType< MutexType > > > legacylockmgr::LockMgr< MutexType, KeyType >::mutexMap_
staticprivate

Definition at line 101 of file LegacyLockMgr.h.


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