14 static TValue
lookup_map_entry (std::map<TKey,TValue> *&_map, std::mutex &_mutex, TKey _key, std::function<TValue (TKey)> create_value)
16 std::lock_guard<std::mutex> lock (_mutex);
17 if (_map ==
nullptr) {
18 _map =
new std::map<TKey,TValue> ();
22 auto entry = _map->find (_key);
23 if (entry == _map->end ()) {
24 ret = create_value (_key);