Commit 38e1bab1 authored by Pavel Vainerman's avatar Pavel Vainerman

(SharedMemory): избавился от забытого gettimeofday

parent 42bbd46a
...@@ -791,8 +791,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* ) ...@@ -791,8 +791,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* )
{ {
sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl; sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl;
it->fuse_sec = sm_tv_sec; it->fuse_tm.tv_sec = sm_tv_sec;
it->fuse_usec = sm_tv_nsec; it->fuse_tm.tv_nsec = sm_tv_nsec;
m_historySignal.emit( (*it) ); m_historySignal.emit( (*it) );
} }
} }
...@@ -810,8 +810,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* ) ...@@ -810,8 +810,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* )
{ {
sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl; sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl;
it->fuse_sec = sm_tv_sec; it->fuse_tm.tv_sec = sm_tv_sec;
it->fuse_usec = sm_tv_nsec; it->fuse_tm.tv_nsec = sm_tv_nsec;
m_historySignal.emit( (*it) ); m_historySignal.emit( (*it) );
} }
} }
...@@ -821,8 +821,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* ) ...@@ -821,8 +821,8 @@ void SharedMemory::checkFuse( std::shared_ptr<USensorInfo>& usi, IOController* )
{ {
sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl; sminfo << myname << "(updateHistory): HISTORY EVENT for " << (*it) << endl;
it->fuse_sec = sm_tv_sec; it->fuse_tm.tv_sec = sm_tv_sec;
it->fuse_usec = sm_tv_nsec; it->fuse_tm.tv_nsec = sm_tv_nsec;
m_historySignal.emit( (*it) ); m_historySignal.emit( (*it) );
} }
} }
......
...@@ -354,13 +354,9 @@ class SharedMemory: ...@@ -354,13 +354,9 @@ class SharedMemory:
id(0), id(0),
size(0), filter(""), size(0), filter(""),
fuse_id(UniSetTypes::DefaultObjectId), fuse_id(UniSetTypes::DefaultObjectId),
fuse_invert(false), fuse_use_val(false), fuse_val(0), fuse_invert(false), fuse_use_val(false), fuse_val(0)
fuse_sec(0), fuse_usec(0)
{ {
struct timeval tv; ::clock_gettime(CLOCK_REALTIME, &fuse_tm);
gettimeofday(&tv, NULL);
fuse_sec = tv.tv_sec;
fuse_usec = tv.tv_usec;
} }
long id; // ID long id; // ID
...@@ -372,8 +368,7 @@ class SharedMemory: ...@@ -372,8 +368,7 @@ class SharedMemory:
bool fuse_use_val; bool fuse_use_val;
long fuse_val; long fuse_val;
// timestamp // timestamp
long fuse_sec; timespec fuse_tm;
long fuse_usec;
}; };
friend std::ostream& operator<<( std::ostream& os, const HistoryInfo& h ); friend std::ostream& operator<<( std::ostream& os, const HistoryInfo& 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