19 #include <rapidjson/document.h>
20 #include <boost/variant.hpp>
30 namespace legacylockmgr {
36 template <
typename MutexType>
74 return mutex_.try_lock_shared();
92 template <
typename MutexType,
typename KeyType>
95 static std::shared_ptr<WrapperType<MutexType>>
getMutex(
const LockType lockType,
100 static std::map<std::tuple<LockType, KeyType>, std::shared_ptr<WrapperType<MutexType>>>
104 template <
typename MutexType,
typename KeyType>
106 template <
typename MutexType,
typename KeyType>
107 std::map<std::tuple<LockType, KeyType>, std::shared_ptr<WrapperType<MutexType>>>
110 template <
typename MutexType,
typename KeyType>
113 const KeyType& key) {
114 auto lock_key = std::make_tuple(lock_type, key);
116 std::unique_lock<std::mutex> lck(aMutex_);
117 auto mit = mutexMap_.find(lock_key);
118 if (mit != mutexMap_.end()) {
122 auto tMutex = std::make_shared<WrapperType<MutexType>>();
123 mutexMap_[lock_key] = tMutex;
static std::shared_ptr< WrapperType< MutexType > > getMutex(const LockType lockType, const KeyType &key)
virtual void unlock_shared()
auto getExecuteReadLock()
std::unique_lock< WrapperType< std::shared_mutex >> ExecutorWriteLock
static std::map< std::tuple< LockType, KeyType >, std::shared_ptr< WrapperType< MutexType > > > mutexMap_
virtual void lock_shared()
This file contains the class specification and related data structures for Catalog.
heavyai::DistributedSharedMutex dmutex_
std::shared_lock< WrapperType< std::shared_mutex >> ExecutorReadLock
virtual bool try_lock_shared()
static std::mutex aMutex_
auto getExecuteWriteLock()
const std::string kLockfilesDirectoryName