I have a problem, I have this pointers in my thread code and they are being modify in there, but when it return to the main the changes are not there like this:
Threads
void threaded_function(Model_factory &mf, ppa::Node *root) { // threads management
try { // n try...
Main
int main(int argc, char *argv[]) { ...
In the main I am creating a node root, then in threads the node is being given sequences and has a bool that changes to true like:
ppa::Node *root;
And in the threads is working (a thread group) I can get and set that bool as I wish, but when the thread group finishes with join all (this is boost) the pointer root give me 0 on this line
cout << root->has_sequence() << endl;
After this goes on and the node is again filled with something, so what I want to ask is why is my node pointer not reflecting the changes in the threads, is it design or am I wrong (likely the second) and what should I do a global root node will that fix my issue, but why?