thread: not joinable?
Hi,
I've written my first boost::thread application, and I
get this assertion:
/boost_1_33_1/libs/thread/src/thread.cpp:223: void
boost::thread::join(): Assertion 'm_joinable' failed.
I call the thread as:
void _pollMode( Controller& ctrl ) {
// do polling ... for my testing, left blank
}
void SomeClass::startPolling() {
m_pCtrl = new Controller;
boost::function
void SomeClass::startPolling() { m_pCtrl = new Controller; boost::function
funcPoll; funcPoll = &_pollMode; m_thr = new boost:thread(boost::bind( funcPoll, *m_pCtrl)); // never get past this line (unless copy ctor modified) }
// snip
Any help/explanation would be appreciated. Rob
Try this instead: void SomeClass::startPolling() { m_pCtrl = new Controller(); m_thr = new boost::thread(boost::bind(&Controller.ThreadFunc, m_pCtrl)); std::cout << "Got here" << std::endl; } Eric
participants (2)
-
Eric Hill
-
Robert Marion