C++ boost::thread, wie man einen thread innerhalb einer Klasse

Wie kann ich einen thread in einem Objekt? Zum Beispiel,

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()); ...

So, dass ich später etwas tun zu können,

abc.thread.interrupt();
abc.thread.join();

Dank.

InformationsquelleAutor 2607 | 2012-02-26
Schreibe einen Kommentar