From 3ba62ef1de77153e5a8c7bad4451b96f6a1678b0 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Sun, 12 Mar 2017 22:00:35 -0600 Subject: 8.10 --- zen/thread.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'zen/thread.h') diff --git a/zen/thread.h b/zen/thread.h index a59f3807..ae4c347e 100755 --- a/zen/thread.h +++ b/zen/thread.h @@ -28,26 +28,26 @@ public: template InterruptibleThread(Function&& f); - bool joinable () const { return stdThread.joinable(); } + bool joinable () const { return stdThread_.joinable(); } void interrupt(); - void join () { stdThread.join(); } - void detach () { stdThread.detach(); } + void join () { stdThread_.join(); } + void detach () { stdThread_.detach(); } template bool tryJoinFor(const std::chrono::duration& relTime) { - if (threadCompleted.wait_for(relTime) == std::future_status::ready) + if (threadCompleted_.wait_for(relTime) == std::future_status::ready) { - stdThread.join(); //runs thread-local destructors => this better be fast!!! + stdThread_.join(); //runs thread-local destructors => this better be fast!!! return true; } return false; } private: - std::thread stdThread; + std::thread stdThread_; std::shared_ptr intStatus_; - std::future threadCompleted; + std::future threadCompleted_; }; //context of worker thread: @@ -376,9 +376,9 @@ template inline InterruptibleThread::InterruptibleThread(Function&& f) : intStatus_(std::make_shared()) { std::promise pFinished; - threadCompleted = pFinished.get_future(); + threadCompleted_ = pFinished.get_future(); - stdThread = std::thread([f = std::forward(f), + stdThread_ = std::thread([f = std::forward(f), intStatus = this->intStatus_, pFinished = std::move(pFinished)]() mutable { -- cgit