{
public:
typedef boost::function<void ()> JobType;
WorkerThread()
{
m_Thread = boost::thread(boost::bind(&WorkerThread::run, boost::ref(this)));
}
~WorkerThread()
{
while (!m_Running)
;
m_Thread.join();
m_Running = false;
}
const bool isRunning() const
{
return m_Running;
}
private:
volatile bool m_Running;
boost::thread m_Thread;
void run()
{
m_Running = true;
BOOST_ASSERT(isRunning());
}
private:
WorkerThread(const WorkerThread& rhs);
WorkerThread& operator = (const WorkerThread& rhs);
};
Regards
-- Craig