Boost logo

Boost Users :

From: Eric Hill (eric_at_[hidden])
Date: 2006-11-21 16:47:06


> void SomeClass::startPolling() {
> m_pCtrl = new Controller;
> boost::function<void (Controller&)> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net