Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Gorshenin <ygorshenin@chromium.org>2015-03-13 17:55:10 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:41:24 +0300
commit2b0f4125289657beaa71b80f5897052d36521104 (patch)
tree31a656501d5afcc9d296c878ebed88aa9b71ce1f /map/benchmark_engine.hpp
parentf7203eb9b75a01270d63e74e8eccebdf531c5742 (diff)
[thread] Refactored lifetime management of multithreaded tasks.
Diffstat (limited to 'map/benchmark_engine.hpp')
-rw-r--r--map/benchmark_engine.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/map/benchmark_engine.hpp b/map/benchmark_engine.hpp
index 08e5354f83..357a778751 100644
--- a/map/benchmark_engine.hpp
+++ b/map/benchmark_engine.hpp
@@ -18,7 +18,7 @@ class Framework;
/// - Feeds the Framework with the paint tasks he wants to performs
/// - Wait until each tasks completion
/// - Measure the time of each task and save the result
-class BenchmarkEngine : public threads::IRoutine
+class BenchmarkEngine
{
threads::Thread m_thread;
@@ -45,6 +45,18 @@ class BenchmarkEngine : public threads::IRoutine
string m_name;
};
+ class Routine : public threads::IRoutine
+ {
+ public:
+ Routine(BenchmarkEngine & engine);
+
+ // threads::IRoutine overrides:
+ void Do() override;
+
+ private:
+ BenchmarkEngine & m_engine;
+ };
+
vector<Benchmark> m_benchmarks;
size_t m_curBenchmark;
@@ -60,8 +72,6 @@ class BenchmarkEngine : public threads::IRoutine
void PrepareMaps();
- void Do();
-
friend class DoGetBenchmarks;
public: