As a follow up of #533 and also detected during #538 #524 tasks, fixed 2 more issues/bugs

* only call this->abandonAndWait() when not in main thread (also slack discussion MS/KB)
* make sure web data service start to read even if setup reader signal was missed
* add timestamp to setupreader to detect "recently read" in case signal is missed
This commit is contained in:
Klaus Basan
2015-12-02 01:01:36 +01:00
parent a863f99c9d
commit 51d4301899
5 changed files with 57 additions and 8 deletions

View File

@@ -30,21 +30,25 @@ namespace BlackMisc
class BLACKMISC_EXPORT CThreadedReader : public CContinuousWorker
{
public:
//! Destructor
virtual ~CThreadedReader();
//! Thread safe, set update timestamp
//! \threadsafe
QDateTime getUpdateTimestamp() const;
//! Thread safe, set update timestamp
//! \threadsafe
void setUpdateTimestamp(const QDateTime &updateTimestamp);
void setUpdateTimestamp(const QDateTime &updateTimestamp = QDateTime::currentDateTimeUtc());
//! Was setup read within last xx milliseconds
//! \threadsafe
bool updatedWithinLastMs(qint64 timeLastMs);
//! Request new reading
//! \note override as required, default is to call initialize()
virtual void requestReload();
//! Destructor
virtual ~CThreadedReader();
//! Set the update time
//! \param updatePeriodMs <=0 stops the timer
//! \threadsafe