4 #include <tbb/concurrent_hash_map.h>
6 #include <unordered_set>
12 typedef tbb::concurrent_hash_map<uint32_t, LockType*>
LockMap;
13 typedef std::unordered_set<LockType*>
LockSet;
39 LockMap::accessor acc;
52 std::pair<LockSet::iterator, bool>
ret =
m_lockSet->insert(lock);
55 if(lock->try_lock_for(std::chrono::milliseconds(100)))
void Unlock()
Definition: lockkey.h:68
static __thread LockSet * m_lockSet
Definition: lockkey.h:80
LockMap m_lockMap
Definition: lockkey.h:79
void Init()
Definition: lockkey.h:27
std::recursive_timed_mutex LockType
Definition: lockkey.h:11
bool Lock(uint32_t key)
Definition: lockkey.h:37
bool ret
Definition: stmskip.cc:242
std::unordered_set< LockType * > LockSet
Definition: lockkey.h:13
~LockKey()
Definition: lockkey.h:19
void Uninit()
Definition: lockkey.h:32
LockKey()
Definition: lockkey.h:16
tbb::concurrent_hash_map< uint32_t, LockType * > LockMap
Definition: lockkey.h:12