Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Uninterupted output of destructors of ros-nodes

I'm having a ros system consiting of different nodes. Each of these nodes has a calback-class that does all the calculations. I define multiple std::couts in the destructors of the classes so that I can get some statistics output of what happened during the execution. This was working fine so far, because I only had one such DTOR defined. But now I thought it might be a good idea to have such statistics for each of my nodes and therefor I added those DTOR to all callback-classes. Now it frequently happens that one DTOR outputs it's first couple of lines, then another DTOR outputs a few lines and then the first DTOR again. Is there a way of making sure, that the output of each DTOR will not be interupted by the output of other DTORs?