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

#include <LegacyLockMgr.h>

Static Public Member Functions

static std::shared_ptr< 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< MutexType > > 
mutexMap_
 

Detailed Description

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

Definition at line 35 of file LegacyLockMgr.h.

Member Function Documentation

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

Definition at line 51 of file LegacyLockMgr.h.

Referenced by Parser::CreateTableStmt::execute(), Parser::CreateDataframeStmt::execute(), Parser::DropTableStmt::execute(), Parser::TruncateTableStmt::execute(), Parser::RenameDatabaseStmt::execute(), Parser::RenameTableStmt::execute(), Parser::AddColumnStmt::execute(), Parser::DropColumnStmt::execute(), Parser::CopyTableStmt::execute(), Parser::ShowCreateTableStmt::execute(), Parser::CreateViewStmt::execute(), Parser::CreateDBStmt::execute(), Parser::DropDBStmt::execute(), Parser::InsertValuesStmt::execute(), DBHandler::get_tables_meta(), DBHandler::sql_execute_impl(), and DBHandler::validate_rel_alg().

52  {
53  auto lock_key = std::make_tuple(lock_type, key);
54 
55  std::unique_lock<std::mutex> lck(aMutex_);
56  auto mit = mutexMap_.find(lock_key);
57  if (mit != mutexMap_.end()) {
58  return mit->second;
59  }
60 
61  auto tMutex = std::make_shared<MutexType>();
62  mutexMap_[lock_key] = tMutex;
63  return tMutex;
64 }
static std::mutex aMutex_
Definition: LegacyLockMgr.h:40
static std::map< std::tuple< LockType, KeyType >, std::shared_ptr< MutexType > > mutexMap_
Definition: LegacyLockMgr.h:41

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 40 of file LegacyLockMgr.h.

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

Definition at line 41 of file LegacyLockMgr.h.


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