Hi
I'm trying to desing a module where two threads (two member methods of my module class) need to have access to the same variables (private member variables of my object of the module class). I'd like the second thread to be called by the first one. The first one's just called by a python script via a proxy.
I tried to do this as follows (based on what I found in the official documenation):
cf.
users.aldebaran-robotics.com/docs/site_e...work/monitoring.html
users.aldebaran-robotics.com/docs/site_e..._robot_software.html
// C++
// in firstFunction(..., const int& parameter, ...)
...
int threadID = getProxy("myModule")->pCall("secondFunction", parameter);
// alternatively: int threadID = getProxy(getName())->pCall("secondFunction", parameter);
...
return 0;
I also tried the following:
// C++
// in firstFunction(..., const int& parameter, ...)
...
int threadID = getParentBroker->getProxy("myModule")->pCall("secondFunction", parameter);
// alternatively: int threadID = getParentBroker->getProxy(getName())->pCall("secondFunction", parameter);
...
return 0;
Sometimes, I get a segmentation fault.
As it turned out so far, the member variables in the second thread just have some random values, which indicates the there is some kind of pointer problem.
What did I do wrong and how can I do this properly?
Any advice is very appreciated! Thanks!