mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
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:
committed by
Mathew Sutcliffe
parent
54448fd2b2
commit
4d3d9fa6be
@@ -21,6 +21,7 @@
|
||||
#include <QTimer>
|
||||
#include <QNetworkReply>
|
||||
#include <QCoreApplication>
|
||||
#include <atomic>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -57,16 +58,20 @@ namespace BlackMisc
|
||||
int interval() const;
|
||||
|
||||
//! Graceful shutdown
|
||||
//! \threadsafe
|
||||
void gracefulShutdown();
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
CThreadedReader(QObject *owner, const QString &name);
|
||||
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
bool m_shutdown = false; //!< in shutdown process
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
std::atomic<bool> m_shutdown { false }; //!< in shutdown process
|
||||
mutable QReadWriteLock m_lock {QReadWriteLock::Recursive}; //!< lock which can be used from the derived classes
|
||||
|
||||
//! Shutdown in progress or finished
|
||||
bool isFinishedOrShutdown() const;
|
||||
|
||||
//! Make sure everthing runs correctly in own thread
|
||||
void threadAssertCheck() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user