From 8da3abcd9466a987814bc1819bfdaf5573c22aa9 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 23 Dec 2015 10:35:36 +0300 Subject: [PATCH] dbms: better [#METR-19278]. --- dbms/src/Interpreters/Aggregator.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index 310f76da85..6c15eb0f6d 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -1498,15 +1498,6 @@ public: return res.str(); } - ~MergingAndConvertingBlockInputStream() - { - if (parallel_merge_data) - { - LOG_TRACE(&Logger::get(__PRETTY_FUNCTION__), "Waiting for threads to finish"); - parallel_merge_data->pool.wait(); - } - } - protected: Block readImpl() override { @@ -1610,6 +1601,12 @@ private: std::condition_variable condvar; ParallelMergeData(size_t threads) : pool(threads) {} + + ~ParallelMergeData() + { + LOG_TRACE(&Logger::get(__PRETTY_FUNCTION__), "Waiting for threads to finish"); + pool.wait(); + } }; std::unique_ptr parallel_merge_data; -- GitLab