Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
c30f71aa
Commit
c30f71aa
authored
9 years ago
by
Joakim Nohlgård
Browse files
Options
Downloads
Patches
Plain Diff
sys/vtimer: Remove timer before adding.
Workaround for a bug which causes the same timer to be added twice.
parent
31f95c40
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/vtimer/vtimer.c
+12
-0
12 additions, 0 deletions
sys/vtimer/vtimer.c
with
12 additions
and
0 deletions
sys/vtimer/vtimer.c
+
12
−
0
View file @
c30f71aa
...
@@ -97,6 +97,12 @@ static inline vtimer_t *node_get_timer(priority_queue_node_t *node)
...
@@ -97,6 +97,12 @@ static inline vtimer_t *node_get_timer(priority_queue_node_t *node)
static
int
set_longterm
(
vtimer_t
*
timer
)
static
int
set_longterm
(
vtimer_t
*
timer
)
{
{
timer
->
priority_queue_entry
.
priority
=
timer
->
absolute
.
seconds
;
timer
->
priority_queue_entry
.
priority
=
timer
->
absolute
.
seconds
;
/* *** UGLY FIX BEGINS *** */
/* Workaround for a bug in a so far undiscovered location which causes the
* vtimer to add the same timer twice, locking the system in an infinite
* loop inside priority_queue_add. */
priority_queue_remove
(
&
longterm_priority_queue_root
,
timer_get_node
(
timer
));
/* *** UGLY FIX ENDS *** */
priority_queue_add
(
&
longterm_priority_queue_root
,
timer_get_node
(
timer
));
priority_queue_add
(
&
longterm_priority_queue_root
,
timer_get_node
(
timer
));
return
0
;
return
0
;
}
}
...
@@ -189,6 +195,12 @@ static int set_shortterm(vtimer_t *timer)
...
@@ -189,6 +195,12 @@ static int set_shortterm(vtimer_t *timer)
{
{
DEBUG
(
"set_shortterm(): Absolute: %"
PRIu32
" %"
PRIu32
"
\n
"
,
timer
->
absolute
.
seconds
,
timer
->
absolute
.
microseconds
);
DEBUG
(
"set_shortterm(): Absolute: %"
PRIu32
" %"
PRIu32
"
\n
"
,
timer
->
absolute
.
seconds
,
timer
->
absolute
.
microseconds
);
timer
->
priority_queue_entry
.
priority
=
timer
->
absolute
.
microseconds
;
timer
->
priority_queue_entry
.
priority
=
timer
->
absolute
.
microseconds
;
/* *** UGLY FIX BEGINS *** */
/* Workaround for a bug in a so far undiscovered location which causes the
* vtimer to add the same timer twice, locking the system in an infinite
* loop inside priority_queue_add. */
priority_queue_remove
(
&
shortterm_priority_queue_root
,
timer_get_node
(
timer
));
/* *** UGLY FIX ENDS *** */
priority_queue_add
(
&
shortterm_priority_queue_root
,
timer_get_node
(
timer
));
priority_queue_add
(
&
shortterm_priority_queue_root
,
timer_get_node
(
timer
));
return
1
;
return
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment