refs #646 Fixed race condition between synchronize() and saveToStoreAsync().

This commit is contained in:
Mathew Sutcliffe
2016-05-18 16:59:14 +01:00
parent d6f7341b3d
commit 5a43ff8d20

View File

@@ -405,6 +405,8 @@ namespace BlackMisc
void CDataCacheRevision::notifyPendingWrite()
{
QMutexLocker lock(&m_mutex);
m_pendingWrite = true;
}
@@ -420,7 +422,7 @@ namespace BlackMisc
{
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)