Austin Schuh | 9b360e9 | 2013-03-27 04:47:04 +0000 | [diff] [blame^] | 1 | #include "thread.h" |
2 | |||||
3 | #include <boost/bind.hpp> | ||||
4 | |||||
5 | |||||
6 | void Thread::Terminate() { | ||||
7 | boost::lock_guard<boost::mutex> lockguard(terminate_mutex_); | ||||
8 | should_terminate_ = true; | ||||
9 | } | ||||
10 | |||||
11 | bool Thread::should_run() { | ||||
12 | boost::lock_guard<boost::mutex> lockguard(terminate_mutex_); | ||||
13 | return !should_terminate_; | ||||
14 | } |