10 #ifndef LLDB_CORE_THREADSAFEDENSEMAP_H
11 #define LLDB_CORE_THREADSAFEDENSEMAP_H
15 #include "llvm/ADT/DenseMap.h"
20 template <
typename _KeyType,
typename _ValueType,
21 typename _MutexType = std::mutex>
29 void Insert(_KeyType k, _ValueType v) {
30 std::lock_guard<_MutexType> guard(
m_mutex);
31 m_map.insert(std::make_pair(k, v));
35 std::lock_guard<_MutexType> guard(
m_mutex);
40 std::lock_guard<_MutexType> guard(
m_mutex);
41 return m_map.lookup(k);
44 bool Lookup(_KeyType k, _ValueType &v) {
45 std::lock_guard<_MutexType> guard(
m_mutex);
54 std::lock_guard<_MutexType> guard(
m_mutex);
65 #endif // LLDB_CORE_THREADSAFEDENSEMAP_H