summaryrefslogtreecommitdiff
path: root/main/sched.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2014-10-14 19:12:58 +0000
committerJonathan Rose <jrose@digium.com>2014-10-14 19:12:58 +0000
commit87b5006ff06dd4a719dca96199e065437f31475d (patch)
tree9591d1f2c570d15ec517060f66cef0a5e9b60c67 /main/sched.c
parent527b58aeb76ef4451dadb12c2c48727840675cbc (diff)
Scheduler: Fix a nasty scheduler caching bug which makes new tasks not execute
Tasks that were marked for pending deletion in the scheduler would be moved to the cache for later reuse, but after being recycled the deleted mark wouldn't be removed resulting in fresh tasks being deleted without reason... and immediately moved back into the cache where they could be reused again. This could cause horrendous things to happen in just about anything that used a scheduler. ASTERISK-24321 #close Reported by: Steve Pitts Review: https://reviewboard.asterisk.org/r/4071/ ........ Merged revisions 425503 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425504 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/sched.c')
-rw-r--r--main/sched.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main/sched.c b/main/sched.c
index 97e07eab5..34f8d5369 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -374,6 +374,7 @@ int ast_sched_add_variable(struct ast_sched_context *con, int when, ast_sched_cb
tmp->resched = when;
tmp->variable = variable;
tmp->when = ast_tv(0, 0);
+ tmp->deleted = 0;
if (sched_settime(&tmp->when, when)) {
sched_release(con, tmp);
} else {