Refactor turn lane passing

This commit is contained in:
Patrick Niklaus
2017-06-16 12:35:04 +00:00
committed by Patrick Niklaus
parent 4f13208ce8
commit 37b8d3acd4
8 changed files with 78 additions and 95 deletions
+18 -1
View File
@@ -27,6 +27,23 @@ struct ConcurrentIDMap
std::unordered_map<KeyType, ValueType, HashType> data;
mutable UpgradableMutex mutex;
ConcurrentIDMap() = default;
ConcurrentIDMap(ConcurrentIDMap &&other)
{
ScopedWriterLock other_lock{other.mutex};
ScopedWriterLock lock{mutex};
data = std::move(other.data);
}
ConcurrentIDMap& operator=(ConcurrentIDMap &&other)
{
ScopedWriterLock other_lock{other.mutex};
ScopedWriterLock lock{mutex};
data = std::move(other.data);
return *this;
}
const ValueType ConcurrentFindOrAdd(const KeyType &key)
{
{
@@ -54,4 +71,4 @@ struct ConcurrentIDMap
} // util
} // osrm
#endif // CONCURRENT_ID_MAP_HPP
#endif // CONCURRENT_ID_MAP_HPP