refs #476, improvements on gracefulShutdown

* gracefulShutdown in metar reader and other readers
* made m_shutdown thread safe
* Demoted log level for reader
* helper function finished or shutdown
This commit is contained in:
Klaus Basan
2015-11-07 18:51:10 +01:00
committed by Mathew Sutcliffe
parent 54448fd2b2
commit 4d3d9fa6be
8 changed files with 28 additions and 15 deletions

View File

@@ -173,7 +173,7 @@ namespace BlackCore
this->threadAssertCheck();
// Worker thread, make sure to write only synced here!
if (this->isFinished())
if (this->isFinishedOrShutdown())
{
CLogMessage(this).debug() << Q_FUNC_INFO;
CLogMessage(this).info("Terminated VATSIM file parsing process"); // for users
@@ -200,9 +200,9 @@ namespace BlackCore
QStringList clientSectionAttributes;
Section section = SectionNone;
foreach(QString currentLine, lines)
for (const QString &cl : lines)
{
if (this->isFinished())
if (this->isFinishedOrShutdown())
{
CLogMessage(this).debug() << Q_FUNC_INFO;
CLogMessage(this).info("Terminated booking parsing process"); // for users
@@ -210,7 +210,7 @@ namespace BlackCore
}
// parse lines
currentLine = currentLine.trimmed();
QString currentLine(cl.trimmed());
if (currentLine.isEmpty()) continue;
if (currentLine.startsWith(";"))
{