【发布时间】:2012-02-26 23:09:36
【问题描述】:
如何在对象中启动线程?例如,
class ABC
{
public:
void Start();
double x;
boost::thread m_thread;
};
ABC abc;
... do something here ...
... how can I start the thread with Start() function?, ...
... e.g., abc.m_thread = boost::thread(&abc.Start()); ...
这样以后我可以做类似的事情,
abc.thread.interrupt();
abc.thread.join();
谢谢。
【问题讨论】:
标签: c++ linux multithreading boost