mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #452, allow to "shutdown" threaded reader
This commit is contained in:
committed by
Mathew Sutcliffe
parent
567cead20d
commit
fc2982c7c3
@@ -34,6 +34,12 @@ namespace BlackMisc
|
||||
QMetaObject::invokeMethod(m_updateTimer, "stop");
|
||||
}
|
||||
|
||||
void CThreadedReader::gracefulShutdown()
|
||||
{
|
||||
this->m_shutdown = true;
|
||||
this->requestStop();
|
||||
}
|
||||
|
||||
CThreadedReader::~CThreadedReader()
|
||||
{
|
||||
cleanup();
|
||||
|
||||
@@ -54,11 +54,16 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
int interval() const;
|
||||
|
||||
//! Graceful shutdown
|
||||
void gracefulShutdown();
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
CThreadedReader(QObject *owner, const QString &name);
|
||||
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
bool m_shutdown = false; //!< in shutdown process
|
||||
|
||||
mutable QReadWriteLock m_lock {QReadWriteLock::Recursive}; //!< lock
|
||||
|
||||
//! Make sure everthing runs correctly in own thread
|
||||
|
||||
Reference in New Issue
Block a user