refs #581 Synchronous loading of data cache value by returning a future.

CDataCacheRevision maintains a list of promises corresponding to the futures, so they can be delivered
when the loading is finished. Corresponding notification slot is inhibited to avoid duplicate notification.
This commit is contained in:
Mathew Sutcliffe
2016-02-04 17:05:17 +00:00
parent bc2e0faa36
commit e0607eb83c
3 changed files with 93 additions and 1 deletions

View File

@@ -224,6 +224,11 @@ namespace BlackMisc
//! Mutex protecting operations which are critical on m_elements.
mutable QMutex m_mutex { QMutex::Recursive };
protected:
//! Synchronously return a current value.
//! \threadsafe
CVariant getValueSync(const QString &key) { return std::get<0>(getValue(key)); }
private:
friend class Private::CValuePage;
struct Element;