diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index 22f5dd8e1..50d49fe25 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -30,6 +30,7 @@ #include #include // for int64_t #include // for std::ostringstream +#include #ifdef SYSTEM_SQLITE // the standard sqlite3.h doesn't give a way to set SQLITE_UINT64_TYPE, @@ -54,7 +55,6 @@ #include #include #include -#include #include
#include
@@ -172,7 +172,7 @@ public: bool isFinished() const { - SGGuard g(_lock); + std::lock_guard g(_lock); return _isFinished; } @@ -183,7 +183,7 @@ public: _cache->doRebuild(); SG_LOG(SG_NAVCACHE, SG_INFO, "cache rebuild took:" << st.elapsedMSec() << "msec"); - SGGuard g(_lock); + std::lock_guard g(_lock); _isFinished = true; _phase = NavDataCache::REBUILD_DONE; } @@ -191,7 +191,7 @@ public: NavDataCache::RebuildPhase currentPhase() const { NavDataCache::RebuildPhase ph; - SGGuard g(_lock); + std::lock_guard g(_lock); ph = _phase; return ph; } @@ -199,14 +199,14 @@ public: unsigned int completionPercent() const { unsigned int perc = 0; - SGGuard g(_lock); + std::lock_guard g(_lock); perc = _completionPercent; return perc; } void setProgress(NavDataCache::RebuildPhase ph, unsigned int percent) { - SGGuard g(_lock); + std::lock_guard g(_lock); _phase = ph; _completionPercent = percent; } @@ -215,7 +215,7 @@ private: NavDataCache* _cache; NavDataCache::RebuildPhase _phase; unsigned int _completionPercent; - mutable SGMutex _lock; + mutable std::mutex _lock; bool _isFinished; }; @@ -2529,7 +2529,7 @@ public: break; } else if (err == SQLITE_ROW) { PositionedID r = sqlite3_column_int64(query, 0); - SGGuard g(lock); + std::lock_guard g(lock); results.push_back(r); } else if (err == SQLITE_BUSY) { // sleep a tiny amount @@ -2540,11 +2540,11 @@ public: } } - SGGuard g(lock); + std::lock_guard g(lock); isComplete = true; } - SGMutex lock; + std::mutex lock; sqlite3* db; sqlite3_stmt_ptr query; PositionedIDVec results; @@ -2576,7 +2576,7 @@ NavDataCache::ThreadedGUISearch::ThreadedGUISearch(const std::string& term, bool NavDataCache::ThreadedGUISearch::~ThreadedGUISearch() { { - SGGuard g(d->lock); + std::lock_guard g(d->lock); d->quit = true; } @@ -2589,7 +2589,7 @@ PositionedIDVec NavDataCache::ThreadedGUISearch::results() const { PositionedIDVec r; { - SGGuard g(d->lock); + std::lock_guard g(d->lock); r = std::move(d->results); } return r; @@ -2597,7 +2597,7 @@ PositionedIDVec NavDataCache::ThreadedGUISearch::results() const bool NavDataCache::ThreadedGUISearch::isComplete() const { - SGGuard g(d->lock); + std::lock_guard g(d->lock); return d->isComplete; } diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx index a021ef880..15b070f72 100644 --- a/src/Traffic/TrafficMgr.cxx +++ b/src/Traffic/TrafficMgr.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -59,11 +60,10 @@ #include #include #include +#include #include #include -#include -#include #include #include @@ -124,7 +124,7 @@ public: bool isFinished() const { - SGGuard g(_lock); + std::lock_guard g(_lock); return _isFinished; } @@ -137,7 +137,7 @@ public: } } - SGGuard g(_lock); + std::lock_guard g(_lock); _isFinished = true; } @@ -394,7 +394,7 @@ private: } FGTrafficManager* _trafficManager; - mutable SGMutex _lock; + mutable std::mutex _lock; bool _isFinished; bool _cancelThread; simgear::PathList _trafficDirPaths;