diff --git a/simgear/debug/logdelta.cxx b/simgear/debug/logdelta.cxx index 6efe42ec..00630d4a 100644 --- a/simgear/debug/logdelta.cxx +++ b/simgear/debug/logdelta.cxx @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -137,6 +138,8 @@ struct logDelta if (!function) function = ""; logDeltaCacheItem flf(file, line, function); + std::lock_guard lock( m_mutex); + auto it = m_cache.find(flf); if (it == m_cache.end()) { @@ -212,6 +215,7 @@ struct logDelta } private: + std::mutex m_mutex; std::map m_cache; std::vector m_items; };