Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
58b55f2a
Commit
58b55f2a
authored
6 years ago
by
Sean Bright
Browse files
Options
Downloads
Patches
Plain Diff
sched: Make sched_settime() return void because it cannot fail
Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5
parent
2b8602e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/sched.c
+7
-13
7 additions, 13 deletions
main/sched.c
with
7 additions
and
13 deletions
main/sched.c
+
7
−
13
View file @
58b55f2a
...
...
@@ -483,7 +483,7 @@ static void schedule(struct ast_sched_context *con, struct sched *s)
* given the last event *tv and the offset in milliseconds 'when',
* computes the next value,
*/
static
int
sched_settime
(
struct
timeval
*
t
,
int
when
)
static
void
sched_settime
(
struct
timeval
*
t
,
int
when
)
{
struct
timeval
now
=
ast_tvnow
();
...
...
@@ -505,7 +505,6 @@ static int sched_settime(struct timeval *t, int when)
if
(
ast_tvcmp
(
*
t
,
now
)
<
0
)
{
*
t
=
now
;
}
return
0
;
}
int
ast_sched_replace_variable
(
int
old_id
,
struct
ast_sched_context
*
con
,
int
when
,
ast_sched_cb
callback
,
const
void
*
data
,
int
variable
)
...
...
@@ -536,12 +535,10 @@ int ast_sched_add_variable(struct ast_sched_context *con, int when, ast_sched_cb
tmp
->
variable
=
variable
;
tmp
->
when
=
ast_tv
(
0
,
0
);
tmp
->
deleted
=
0
;
if
(
sched_settime
(
&
tmp
->
when
,
when
))
{
sched_release
(
con
,
tmp
);
}
else
{
schedule
(
con
,
tmp
);
res
=
tmp
->
sched_id
->
id
;
}
sched_settime
(
&
tmp
->
when
,
when
);
schedule
(
con
,
tmp
);
res
=
tmp
->
sched_id
->
id
;
}
#ifdef DUMP_SCHEDULER
/* Dump contents of the context while we have the lock so nothing gets screwed up by accident. */
...
...
@@ -787,11 +784,8 @@ int ast_sched_runq(struct ast_sched_context *con)
* If they return non-zero, we should schedule them to be
* run again.
*/
if
(
sched_settime
(
&
current
->
when
,
current
->
variable
?
res
:
current
->
resched
))
{
sched_release
(
con
,
current
);
}
else
{
schedule
(
con
,
current
);
}
sched_settime
(
&
current
->
when
,
current
->
variable
?
res
:
current
->
resched
);
schedule
(
con
,
current
);
}
else
{
/* No longer needed, so release it */
sched_release
(
con
,
current
);
...
...
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