加锁
/*
NOTICE:
m_eraseMutex is used for eraseKey() method with tbb::concurrent_unordered_map
instance only. Because in that eraseKey() method, we use unsafe_erase() method to delete element in tbb::concurrent_unordered_map instance. As "unsafe_" prefix says, the unsafe_erase() method can NOT ensure concurrenty safety between different calls to this method, that's why we used a mutex to ensure there is only one thread can erase element each time.
Additionally, by now no evidence shows that unsafe_erase() method would conflict with insert()
or find() method. To get furthur details about the data structure used in tbb::concurrent_unordered_map, maybe you could read: http://www.cs.ucf.edu/~dcm/Teaching/COT4810-Spring2011/Literature/SplitOrderedLists.pdf
*/
std::mutex m_eraseMutex;
void eraseKey(ConcurrentMap& _map, KeyType const& _key)
{
std::lock_guard<std::mutex> lock(m_eraseMutex);
_map.unsafe_erase(_key);
}