mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user