summaryrefslogtreecommitdiff
path: root/main/sched.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2010-08-10 18:05:40 +0000
committerRussell Bryant <russell@russellbryant.com>2010-08-10 18:05:40 +0000
commit461f9b004e5f21a4e131bcbe20f38e06c042fbe8 (patch)
tree955f083a704e737f9485e30f572e79d66ddc32bc /main/sched.c
parent2a4392008ce56e6e12178b18529515b5471d747c (diff)
Merged revisions 281575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r281575 | russell | 2010-08-10 13:05:07 -0500 (Tue, 10 Aug 2010) | 16 lines Merged revisions 281574 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r281574 | russell | 2010-08-10 13:04:32 -0500 (Tue, 10 Aug 2010) | 9 lines Don't move the time threshold for running scheduled events on every iteration. Instead, only calculate the time threshold each time ast_sched_runq() is called. (closes issue #17742) Reported by: schmidts Patches: sched.c.patch uploaded by schmidts (license 1077) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@281576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/sched.c')
-rw-r--r--main/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/sched.c b/main/sched.c
index 78de1a99e..8a3602a39 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -604,13 +604,13 @@ int ast_sched_runq(struct sched_context *con)
ast_mutex_lock(&con->lock);
+ when = ast_tvadd(ast_tvnow(), ast_tv(0, 1000));
for (numevents = 0; (current = ast_heap_peek(con->sched_heap, 1)); numevents++) {
/* schedule all events which are going to expire within 1ms.
* We only care about millisecond accuracy anyway, so this will
* help us get more than one event at one time if they are very
* close together.
*/
- when = ast_tvadd(ast_tvnow(), ast_tv(0, 1000));
if (ast_tvcmp(current->when, when) != -1) {
break;
}