Squashed commit of the following:
commit
57c873106b055daf409b5a712a98f67d642c8d1a
Author: Dipto Pandit (dipandit) <dipandit@cisco.com>
Date: Mon Apr 19 02:43:27 2021 -0400
hash: prepond object creation in LRU cache find_else_create
// return the data pointer (below), or else, some other thread might
// delete it before we got a chance to return it.
Purgatory tmp_data;
+ Data data = Data(new Value);
std::lock_guard<std::mutex> cache_lock(cache_mutex);
stats.adds++;
if ( new_data )
*new_data = true;
- Data data = Data(new Value);
// Add key/data pair to front of list.
list.emplace_front(std::make_pair(key, data));