Do topic callbacks and timer callbacks run in the same thread?
The title says it all actually. I wonder whether I need to protect my subscription callbacks from my timer callbacks with a mutex:
eventSubscriber = nh.subscribe("my_topic", 1, &MyNodeClass::topicCallback, this);
timer = nh.createTimer(my_period_, boost::bind(&MyNodeClass::timerCallback, this, _1));
Can topicCallback
and timerCallback
be executed in parallel?