Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xenomai
xenomai
Commits
7fffb263
Commit
7fffb263
authored
Apr 18, 2018
by
Philippe Gerum
Browse files
copperplate/threadobj: do not leak the periodic timer
parent
f71f6690
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/copperplate/threadobj.c
View file @
7fffb263
...
...
@@ -1631,6 +1631,14 @@ int threadobj_set_periodic(struct threadobj *thobj,
__threadobj_check_locked
(
thobj
);
timer
=
thobj
->
periodic_timer
;
if
(
!
timespec_scalar
(
idate
)
&&
!
timespec_scalar
(
period
))
{
if
(
timer
)
{
thobj
->
periodic_timer
=
NULL
;
__RT
(
timer_delete
(
timer
));
}
return
0
;
}
if
(
timer
==
NULL
)
{
memset
(
&
sev
,
0
,
sizeof
(
sev
));
sev
.
sigev_signo
=
SIGPERIOD
;
...
...
@@ -1640,8 +1648,7 @@ int threadobj_set_periodic(struct threadobj *thobj,
if
(
ret
)
return
__bt
(
-
errno
);
thobj
->
periodic_timer
=
timer
;
}
else
if
(
!
timespec_scalar
(
idate
)
&&
!
timespec_scalar
(
period
))
thobj
->
periodic_timer
=
NULL
;
}
its
.
it_value
=
*
idate
;
its
.
it_interval
=
*
period
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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