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
46dae9ad
Commit
46dae9ad
authored
Sep 11, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UniSetTimer): Небольшие изменения в функциях millisecToPoco() and microsecToPoco()
(UniSetActivator): подправил логи при stacktrace
parent
f84f65dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
13 deletions
+10
-13
libuniset2.spec
conf/libuniset2.spec
+4
-1
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+2
-0
PassiveTimer.cc
src/Timers/PassiveTimer.cc
+2
-12
test_passivetimer.cc
tests/test_passivetimer.cc
+2
-0
No files found.
conf/libuniset2.spec
View file @
46dae9ad
...
...
@@ -14,7 +14,7 @@
Name: libuniset2
Version: 2.5
Release: alt1
2
Release: alt1
3
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
...
...
@@ -486,6 +486,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
%changelog
* Fri Sep 09 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt13
- minor fixes in millisecToPoco() and microsecToPoco() functions
* Thu Sep 08 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt12
- up build
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
46dae9ad
...
...
@@ -234,10 +234,12 @@ bool gdb_print_trace()
if
(
g_act
&&
!
g_act
->
getAbortScript
().
empty
()
)
{
TRACELOG
<<
"run script: "
<<
g_act
->
getAbortScript
()
<<
" for stack trace: proc "
<<
name_buf
<<
" pid="
<<
pid_buf
<<
endl
;
execlp
(
g_act
->
getAbortScript
().
c_str
(),
g_act
->
getAbortScript
().
c_str
(),
name_buf
,
pid_buf
,
NULL
);
}
else
{
TRACELOG
<<
"direct run gdb for stack trace for pid="
<<
pid_buf
<<
" name="
<<
name_buf
<<
" ..."
<<
endl
;
// приходится выводить информацию по всем потокам, т.к. мы не знаем в каком сработал сигнал
// его надо смотреть по выводу "<signal handler called>"
execlp
(
"gdb"
,
"gdb"
,
"--batch"
,
"-n"
,
"-ex"
,
"thread apply all bt"
,
name_buf
,
pid_buf
,
NULL
);
...
...
src/Timers/PassiveTimer.cc
View file @
46dae9ad
...
...
@@ -113,13 +113,8 @@ void UniSetTimer::stop()
//------------------------------------------------------------------------------
const
Poco
::
Timespan
UniSetTimer
::
millisecToPoco
(
const
timeout_t
msec
)
{
#ifdef POCO_OLD_VERSION
if
(
msec
==
WaitUpTime
)
return
Poco
::
Timespan
(
std
::
numeric_limits
<
Poco
::
Timestamp
::
TimeVal
>::
max
(),
0
);
#else
if
(
msec
==
WaitUpTime
)
return
Poco
::
Timespan
(
Poco
::
Timestamp
::
TIMEVAL_MAX
,
0
);
#endif
return
Poco
::
Timespan
(
-
1
,
0
);
// msec --> usec
return
Poco
::
Timespan
(
long
(
msec
/
1000
),
long
((
msec
*
1000
)
%
1000000
)
);
...
...
@@ -127,13 +122,8 @@ const Poco::Timespan UniSetTimer::millisecToPoco( const timeout_t msec )
//------------------------------------------------------------------------------
const
Poco
::
Timespan
UniSetTimer
::
microsecToPoco
(
const
timeout_t
usec
)
{
#ifdef POCO_OLD_VERSION
if
(
usec
==
WaitUpTime
)
return
Poco
::
Timespan
(
std
::
numeric_limits
<
Poco
::
Timestamp
::
TimeVal
>::
max
(),
0
);
#else
if
(
usec
==
WaitUpTime
)
return
Poco
::
Timespan
(
Poco
::
Timestamp
::
TIMEVAL_MAX
,
0
);
#endif
return
Poco
::
Timespan
(
-
1
,
0
);
return
Poco
::
Timespan
(
long
(
usec
/
1000000
),
long
(
usec
%
1000000
)
);
}
...
...
tests/test_passivetimer.cc
View file @
46dae9ad
...
...
@@ -109,6 +109,7 @@ TEST_CASE("UniSetTimer: conv to Poco", "[PassiveTimer][poco]" )
Poco
::
Timespan
tm
=
UniSetTimer
::
millisecToPoco
(
UniSetTimer
::
WaitUpTime
);
REQUIRE
(
tm
.
seconds
()
==
-
1
);
REQUIRE
(
tm
.
microseconds
()
==
0
);
REQUIRE
(
tm
.
totalMilliseconds
()
<
0
);
}
{
...
...
@@ -124,6 +125,7 @@ TEST_CASE("UniSetTimer: conv to Poco", "[PassiveTimer][poco]" )
Poco
::
Timespan
tm
=
UniSetTimer
::
microsecToPoco
(
UniSetTimer
::
WaitUpTime
);
REQUIRE
(
tm
.
seconds
()
==
-
1
);
REQUIRE
(
tm
.
microseconds
()
==
0
);
REQUIRE
(
tm
.
totalMilliseconds
()
<
0
);
}
{
Poco
::
Timespan
tm
=
UniSetTimer
::
microsecToPoco
(
2000000
);
...
...
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