aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-12 09:57:38 +0200
committerDan Engelbrecht <[email protected]>2022-04-12 13:53:07 +0200
commit53c9f9b3e254cdf9f04067c4dec97c8dedca9c95 (patch)
treefc5e2674799d3b44165fecdfd0e89d784717642c
parentuse zen::UnsignedIntegral instead of std::unsigned_integral (diff)
downloadzen-53c9f9b3e254cdf9f04067c4dec97c8dedca9c95.tar.xz
zen-53c9f9b3e254cdf9f04067c4dec97c8dedca9c95.zip
Be more strict with m_TotalSize atomic operations
-rw-r--r--zenstore/compactcas.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index 51fe7a901..ce93a3320 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -330,7 +330,7 @@ CasContainerStrategy::InsertChunk(const void* ChunkData, size_t ChunkSize, const
WriteBlock->Write(ChunkData, ChunkSize, InsertOffset);
m_CasLog.Append(IndexEntry);
- m_TotalSize.fetch_add(static_cast<uint64_t>(ChunkSize), std::memory_order_release);
+ m_TotalSize.fetch_add(static_cast<uint64_t>(ChunkSize), std::memory_order_seq_cst);
{
RwLock::ExclusiveLockScope __(m_LocationMapLock);
m_LocationMap.emplace(ChunkHash, Location);
@@ -1484,7 +1484,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore)
for (const auto& Entry : m_LocationMap)
{
const BlockStoreDiskLocation& Location = Entry.second;
- m_TotalSize.fetch_add(Location.GetSize(), std::memory_order_release);
+ m_TotalSize.fetch_add(Location.GetSize(), std::memory_order_seq_cst);
KnownBlocks.insert(Location.GetBlockIndex());
}