如何在对象内启动线程?例如,C++ boost ::线程,如何启动线程内的线程
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();
感谢。
谢谢盖伊,它工作得很好。 – 2607 2012-02-26 23:50:26