aboutsummaryrefslogtreecommitdiff
path: root/zenstore/compactcas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-03-31 11:32:37 +0200
committerDan Engelbrecht <[email protected]>2022-03-31 11:32:37 +0200
commit7ba7efa5b8f0a28f8ad62da47458fa80415cd9d9 (patch)
tree9c90d2edebc301970bf2b9fb49993211e6e20479 /zenstore/compactcas.cpp
parentImproved GC logging (diff)
downloadzen-7ba7efa5b8f0a28f8ad62da47458fa80415cd9d9.tar.xz
zen-7ba7efa5b8f0a28f8ad62da47458fa80415cd9d9.zip
remove WorkerThreadPool::Flush()
Diffstat (limited to 'zenstore/compactcas.cpp')
-rw-r--r--zenstore/compactcas.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index 5f335816c..3cb7d8854 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -2372,7 +2372,10 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
ZEN_ASSERT(InsertResult.New);
});
}
- ThreadPool.Flush();
+ while (ThreadPool.PendingWork() > 0)
+ {
+ Sleep(1);
+ }
}
const uint64_t TotalSize = Cas.StorageSize().DiskSize;
@@ -2389,7 +2392,10 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
CHECK(ChunkHash == Hash);
});
}
- ThreadPool.Flush();
+ while (ThreadPool.PendingWork() > 0)
+ {
+ Sleep(1);
+ }
}
std::unordered_set<IoHash, IoHash::Hasher> GcChunkHashes(ChunkHashes.begin(), ChunkHashes.end());
@@ -2473,7 +2479,10 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
Deleted.IterateChunks([&GcChunkHashes](const IoHash& ChunkHash) { GcChunkHashes.erase(ChunkHash); });
}
- ThreadPool.Flush();
+ while (ThreadPool.PendingWork() > 0)
+ {
+ Sleep(1);
+ }
{
std::vector<IoHash> AddedHashes;
@@ -2517,7 +2526,10 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
CHECK(ChunkHash == IoHash::HashBuffer(Cas.FindChunk(ChunkHash)));
});
}
- ThreadPool.Flush();
+ while (ThreadPool.PendingWork() > 0)
+ {
+ Sleep(1);
+ }
}
}
}