mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #495 Using LockFree to make CCached::get() threadsafe.
This commit is contained in:
@@ -156,7 +156,8 @@ namespace BlackMisc
|
||||
m_element(m_page.createElement(key, qMetaTypeId<T>(), wrap(validator), CVariant::from(defaultValue), slot_cast(slot)))
|
||||
{}
|
||||
|
||||
//! Read the current value. Must be called from the thread in which the owner lives.
|
||||
//! Read the current value.
|
||||
//! \threadsafe
|
||||
const T &get() const { static const T empty {}; return *(isValid() ? static_cast<const T *>(getVariant().data()) : &empty); }
|
||||
|
||||
//! Write a new value. Must be called from the thread in which the owner lives.
|
||||
|
||||
Reference in New Issue
Block a user