26 namespace Catalog_Namespace {
47 template <
typename inner_type>
49 std::thread::id tid = std::this_thread::get_id();
51 if (cat->thread_holding_write_lock != tid && !inner_type::thread_holds_read_lock) {
58 inner_type::thread_holds_read_lock =
true;
70 T::thread_holds_read_lock =
false;
91 template <
typename inner_type>
93 std::thread::id tid = std::this_thread::get_id();
95 if (cat->thread_holding_sqlite_lock != tid) {
102 cat->thread_holding_sqlite_lock = tid;
116 std::thread::id no_thread;
117 catalog->thread_holding_sqlite_lock = no_thread;
129 template <
typename T>
136 template <
typename inner_type>
138 std::thread::id tid = std::this_thread::get_id();
140 if (cat->thread_holding_write_lock != tid) {
147 cat->thread_holding_write_lock = tid;
159 std::thread::id no_thread;
160 catalog->thread_holding_write_lock = no_thread;
void lock_catalog(const inner_type *cat)
std::shared_lock< T > shared_lock
sqlite_lock(const T *cat)
heavyai::unique_lock< heavyai::DistributedSharedMutex > dlock
std::unique_lock< T > unique_lock
heavyai::shared_lock< heavyai::DistributedSharedMutex > dlock
heavyai::unique_lock< heavyai::shared_mutex > lock
read_lock< T > cat_read_lock
void lock_catalog(const inner_type *cat)
bool g_enable_watchdog false
heavyai::unique_lock< heavyai::DistributedSharedMutex > dlock
heavyai::shared_lock< heavyai::shared_mutex > lock
heavyai::unique_lock< std::mutex > lock
void lock_catalog(const inner_type *cat)