mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #646 Fixed race condition between synchronize() and saveToStoreAsync().
This commit is contained in:
@@ -405,6 +405,8 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CDataCacheRevision::notifyPendingWrite()
|
void CDataCacheRevision::notifyPendingWrite()
|
||||||
{
|
{
|
||||||
|
QMutexLocker lock(&m_mutex);
|
||||||
|
|
||||||
m_pendingWrite = true;
|
m_pendingWrite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +422,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
|
|
||||||
return (m_updateInProgress || beginUpdate({{ key, timestamp }}, false)) && m_timestamps.contains(key);
|
return (m_updateInProgress || m_pendingWrite || beginUpdate({{ key, timestamp }}, false)) && m_timestamps.contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::future<void> CDataCacheRevision::promiseLoadedValue(const QString &key, qint64 currentTimestamp)
|
std::future<void> CDataCacheRevision::promiseLoadedValue(const QString &key, qint64 currentTimestamp)
|
||||||
|
|||||||
Reference in New Issue
Block a user