Improved graceful shutdown, added "m_shutdownInProgress"

* no assert when wait is called in same thread, just ignore wait
* quitAndWait readers, also works if not already noved in new thread (see above)
This commit is contained in:
Klaus Basan
2018-03-19 21:04:17 +01:00
parent 9dabef447f
commit d6fd53287f
8 changed files with 71 additions and 29 deletions

View File

@@ -42,6 +42,7 @@
#include <QObject>
#include <QString>
#include <QStringList>
#include <atomic>
namespace BlackMisc
{
@@ -580,7 +581,7 @@ namespace BlackCore
BlackCore::Db::CDatabaseReaderConfigList m_dbReaderConfig; //!< how to read DB data
bool m_initialRead = false; //!< initial read started
bool m_signalledHeaders = false; //!< headers loading has been signalled
bool m_shuttingDown = false; //!< shutting down?
std::atomic_bool m_shuttingDown { false }; //!< shutting down?
QDateTime m_dbInfoObjectTimeout; //!< started reading DB info objects
QDateTime m_sharedInfoObjectsTimeout; //!< started reading shared info objects
QSet<BlackMisc::Network::CEntityFlags::Entity> m_signalledEntities; //!< remember signalled entites