Simplify CThreadedReader to avoid race conditions

refs #731
This commit is contained in:
Roland Winklmeier
2016-08-11 23:18:51 +02:00
committed by Mathew Sutcliffe
parent 6b0412d68d
commit 4733c72553
9 changed files with 86 additions and 130 deletions

View File

@@ -63,7 +63,7 @@ namespace BlackCore
//! \name BlackCore::CThreadedReader overrides
//! @{
virtual void cleanup() override;
virtual BlackCore::Vatsim::CReaderSettings getSettings() const override;
virtual void doWorkImpl() override;
//! @}
private:
@@ -74,10 +74,12 @@ namespace BlackCore
//! Do reading
void readMetars();
void reloadSettings();
private:
BlackMisc::Weather::CMetarDecoder m_metarDecoder;
BlackMisc::Weather::CMetarList m_metars;
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimMetars> m_settings { this };
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimMetars> m_settings { this, &CVatsimMetarReader::reloadSettings };
};
} // ns
} // ns