Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
38e1bab1
Commit
38e1bab1
authored
Aug 21, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(SharedMemory): избавился от забытого gettimeofday
parent
42bbd46a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+6
-6
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+3
-8
No files found.
extensions/SharedMemory/SharedMemory.cc
View file @
38e1bab1
...
@@ -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_
u
sec
=
sm_tv_nsec
;
it
->
fuse_
tm
.
tv_n
sec
=
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_
u
sec
=
sm_tv_nsec
;
it
->
fuse_
tm
.
tv_n
sec
=
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_
u
sec
=
sm_tv_nsec
;
it
->
fuse_
tm
.
tv_n
sec
=
sm_tv_nsec
;
m_historySignal
.
emit
(
(
*
it
)
);
m_historySignal
.
emit
(
(
*
it
)
);
}
}
}
}
...
...
extensions/SharedMemory/SharedMemory.h
View file @
38e1bab1
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment