From bf02f32482a7370d6a719c8b07864b90d21e8378 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Tue, 13 Sep 2016 23:03:16 +0300 Subject: [PATCH] small refactoring --- sample/main.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sample/main.cpp b/sample/main.cpp index c741a24..351812d 100644 --- a/sample/main.cpp +++ b/sample/main.cpp @@ -191,7 +191,6 @@ int main(int argc, char* argv[]) EASY_MAIN_THREAD; std::vector threads; - std::thread render = std::thread(renderThread); std::thread modelling = std::thread(modellingThread); @@ -201,10 +200,10 @@ int main(int argc, char* argv[]) threads.emplace_back(std::thread(renderThread)); threads.emplace_back(std::thread(modellingThread)); } - { - std::lock_guard lk(cv_m); - g_i = 1; - } + + cv_m.lock(); + g_i = 1; + cv_m.unlock(); cv.notify_all(); for (int i = 0; i < RENDER_STEPS; ++i) { @@ -214,9 +213,8 @@ int main(int argc, char* argv[]) render.join(); modelling.join(); - for(auto& t : threads){ + for(auto& t : threads) t.join(); - } /**/ auto end = std::chrono::system_clock::now();