Skip to content

Commit fab61d3

Browse files
authored
Merge pull request PowerDNS#17468 from rgacogne/ddist-fix-cache-bench
dnsdist: Fix the packet cache micro-benchmarks
2 parents cc94dfb + 298afdf commit fab61d3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pdns/dnsdistdist/bench-dnsdist-cache.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ TEST_CASE("Cache/Lookup")
8888

8989
BENCHMARK(std::to_string(threadsCount))
9090
{
91+
threads.clear();
9192
for (size_t idx = 0U; idx < threadsCount; idx++) {
92-
threads.emplace_back(std::thread(testCode, iterations / threadsCount));
93+
threads.emplace_back(testCode, iterations / threadsCount);
9394
}
9495
for (auto& thread : threads) {
9596
thread.join();
@@ -133,8 +134,9 @@ TEST_CASE("Cache/Insertion")
133134

134135
BENCHMARK(std::to_string(threadsCount))
135136
{
137+
threads.clear();
136138
for (size_t idx = 0U; idx < threadsCount; idx++) {
137-
threads.emplace_back(std::thread(testCode, iterations / threadsCount));
139+
threads.emplace_back(testCode, iterations / threadsCount);
138140
}
139141
for (auto& thread : threads) {
140142
thread.join();

0 commit comments

Comments
 (0)