1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-15 02:20:09 +00:00

Fixed a bug that prevented the update of all shared map structures

(ephemeris, iono parameters, etc...)
This commit is contained in:
Javier Arribas 2014-05-06 11:59:48 +02:00
parent 7c0a614ca3
commit eac73b5baa

View File

@ -52,7 +52,15 @@ public:
void write(int key, Data const& data)
{
boost::mutex::scoped_lock lock(the_mutex);
the_map.insert(std::pair<int, Data>(key, data));
Data_iterator data_iter;
data_iter = the_map.find(key);
if (data_iter != the_map.end())
{
data_iter->second=data; //update
}else{
the_map.insert(std::pair<int, Data>(key, data));//insert SILENTLY fails if the item exist in the map!!
}
lock.unlock();
}