diff --git a/src/Storage.h b/src/Storage.h index 3a28b36d0e..6f913a55b1 100644 --- a/src/Storage.h +++ b/src/Storage.h @@ -22,6 +22,8 @@ namespace nt { +class StorageTest; + class StorageEntry { public: StorageEntry() : m_flags(0), m_id(0xffff) {} @@ -70,6 +72,7 @@ class StorageEntry { }; class Storage { + friend class StorageTest; public: static Storage& GetInstance() { if (!m_instance) m_instance.reset(new Storage); @@ -77,8 +80,6 @@ class Storage { } ~Storage(); - typedef llvm::StringMap> EntriesMap; - struct Update { std::shared_ptr entry; enum Kind { kAssign, kValueUpdate, kFlagsUpdate, kDelete, kDeleteAll }; @@ -111,6 +112,8 @@ class Storage { Storage(const Storage&) = delete; Storage& operator=(const Storage&) = delete; + typedef llvm::StringMap> EntriesMap; + mutable std::mutex m_mutex; EntriesMap m_entries; UpdateQueue m_updates;