aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-12 14:47:32 +0200
committerDan Engelbrecht <[email protected]>2022-04-12 22:20:47 +0200
commit2f362392dd2eba0d949e261ce5781965b8943d30 (patch)
tree5dc685bf573298459bb6db1f9e97a3d59e798be8 /zenserver/cache/structuredcachestore.cpp
parentMake sure we generate unique chunks (diff)
downloadzen-2f362392dd2eba0d949e261ce5781965b8943d30.tar.xz
zen-2f362392dd2eba0d949e261ce5781965b8943d30.zip
remove unneeded lock in threaded test
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 9ae01c5df..2746dc673 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -3213,7 +3213,6 @@ TEST_CASE("z$.threadedinsert") // * doctest::skip(true))
}
}
- RwLock ChunkHashesLock;
std::atomic_uint32_t AddedChunkCount;
for (const auto& Chunk : NewChunks)
@@ -3236,13 +3235,8 @@ TEST_CASE("z$.threadedinsert") // * doctest::skip(true))
}
while (AddedChunkCount.load() < NewChunks.size())
{
- std::unordered_map<IoHash, Chunk, IoHash::Hasher> AddedChunks;
- {
- RwLock::ExclusiveLockScope _(ChunkHashesLock);
- AddedChunks.swap(NewChunks);
- }
// Need to be careful since we might GC blocks we don't know outside of RwLock::ExclusiveLockScope
- for (const auto& Chunk : AddedChunks)
+ for (const auto& Chunk : NewChunks)
{
ZenCacheValue CacheValue;
if (Zcs.Get(Chunk.second.Bucket, Chunk.first, CacheValue))
@@ -3289,13 +3283,8 @@ TEST_CASE("z$.threadedinsert") // * doctest::skip(true))
}
{
- std::unordered_map<IoHash, Chunk, IoHash::Hasher> AddedChunks;
- {
- RwLock::ExclusiveLockScope _(ChunkHashesLock);
- AddedChunks.swap(NewChunks);
- }
// Need to be careful since we might GC blocks we don't know outside of RwLock::ExclusiveLockScope
- for (const auto& Chunk : AddedChunks)
+ for (const auto& Chunk : NewChunks)
{
ZenCacheValue CacheValue;
if (Zcs.Get(Chunk.second.Bucket, Chunk.first, CacheValue))