Boost logo

Boost Users :

Subject: [Boost-users] Boost Thread with own Callback implementation
From: programmine (Angie1984_at_[hidden])
Date: 2009-04-23 05:53:49


I am using boost::thread for starting a member function of an object in a
seperate thread.
This works for an example like this:

ProcessData *data = new ProcessData();
ProcessManager *pm = new ProcessManager();
boost::thread t1(&ProcessManager::start, boost::ref(pm), data);

Unfortunately I am not using the ProcessManager directly but a Controller
which uses a self implemented callback functionality. It looks like this:

typedef Callback1 startProcessingEvent;
startProcessingEvent::Signal onStartProcessing;

The ProcessManager is binded to this event and I could call the method like

myController->onStartProcessing(data);

so in the end the ProcessManager->start is called through the Controller.
If I know want to run the same thing in a separate thread I cannot just do
this:

boost::thread t1(&Controller::onStartProcessing, boost::ref(myController),
data);

because boost does not understand the whole callback thing.
Does anyone has an idea how to solve the problem?

Thanks

-- 
View this message in context: http://www.nabble.com/Boost-Thread-with-own-Callback-implementation-tp23193808p23193808.html
Sent from the Boost - Users mailing list archive at Nabble.com.



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