From eac73b5baac0e15093a376199ccd50e800338308 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 6 May 2014 11:59:48 +0200 Subject: [PATCH] Fixed a bug that prevented the update of all shared map structures (ephemeris, iono parameters, etc...) --- src/core/receiver/concurrent_map.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/receiver/concurrent_map.h b/src/core/receiver/concurrent_map.h index 84e00ad22..d0734092c 100644 --- a/src/core/receiver/concurrent_map.h +++ b/src/core/receiver/concurrent_map.h @@ -52,7 +52,15 @@ public: void write(int key, Data const& data) { boost::mutex::scoped_lock lock(the_mutex); - the_map.insert(std::pair(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(key, data));//insert SILENTLY fails if the item exist in the map!! + } lock.unlock(); }