Commit 4b5597d6 authored by Olivier Stasse's avatar Olivier Stasse

[debug] Logger - Fix race condition

Race condition if the value reach zero, then the time sample
has to be reset to timeSamplePeriod.
parent 14e57e84
......@@ -78,7 +78,10 @@ namespace dynamicgraph
if(it->second>0.0)
{
it->second -= m_timeSample;
return;
if (it->second<=0.0)
it->second = m_streamPrintPeriod;
else
return;
}
else // otherwise reset counter and print
it->second = m_streamPrintPeriod;
......
......@@ -7,12 +7,13 @@
*/
#include <sstream>
#include <iostream>
#define ENABLE_RT_LOG
#include <dynamic-graph/entity.h>
#include <dynamic-graph/exception-factory.h>
#include "dynamic-graph/factory.h"
#include "dynamic-graph/pool.h"
#define ENABLE_RT_LOG
#include <dynamic-graph/real-time-logger.h>
#include <dynamic-graph/logger.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment