diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-10 20:57:25 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-10 20:57:25 +0000 |
commit | 629f375c6772f9b889e7d31fe168b42ebb97310a (patch) | |
tree | 196064a73ee9fe49161ea581c2b372ccfe10926b /main/sched.c | |
parent | 9ae91f799ab15938b69b072b681fb606286d08ea (diff) |
That's all, folks. Not going to update the Makefile until res_jabber is
converted (snuffy, you there? :))
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137110 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/sched.c')
-rw-r--r-- | main/sched.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/main/sched.c b/main/sched.c index e98accc72..712b85759 100644 --- a/main/sched.c +++ b/main/sched.c @@ -245,17 +245,17 @@ static void schedule(struct 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 *tv, int when) +static int sched_settime(struct timeval *t, int when) { struct timeval now = ast_tvnow(); /*ast_debug(1, "TV -> %lu,%lu\n", tv->tv_sec, tv->tv_usec);*/ - if (ast_tvzero(*tv)) /* not supplied, default to now */ - *tv = now; - *tv = ast_tvadd(*tv, ast_samp2tv(when, 1000)); - if (ast_tvcmp(*tv, now) < 0) { + if (ast_tvzero(*t)) /* not supplied, default to now */ + *t = now; + *t = ast_tvadd(*t, ast_samp2tv(when, 1000)); + if (ast_tvcmp(*t, now) < 0) { ast_debug(1, "Request to schedule in the past?!?!\n"); - *tv = now; + *t = now; } return 0; } @@ -428,7 +428,7 @@ char *ast_sched_report(struct sched_context *con, char *buf, int bufsiz, struct void ast_sched_dump(const struct sched_context *con) { struct sched *q; - struct timeval tv = ast_tvnow(); + struct timeval when = ast_tvnow(); #ifdef SCHED_MAX_CACHE ast_debug(1, "Asterisk Schedule Dump (%d in Q, %d Total, %d Cache, %d high-water)\n", con->schedcnt, con->eventcnt - 1, con->schedccnt, con->highwater); #else @@ -439,7 +439,7 @@ void ast_sched_dump(const struct sched_context *con) ast_debug(1, "|ID Callback Data Time (sec:ms) |\n"); ast_debug(1, "+-----+-----------------+-----------------+-----------------+\n"); AST_DLLIST_TRAVERSE(&con->schedq, q, list) { - struct timeval delta = ast_tvsub(q->when, tv); + struct timeval delta = ast_tvsub(q->when, when); ast_debug(1, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n", q->id, @@ -458,7 +458,7 @@ void ast_sched_dump(const struct sched_context *con) int ast_sched_runq(struct sched_context *con) { struct sched *current; - struct timeval tv; + struct timeval when; int numevents; int res; @@ -472,8 +472,8 @@ int ast_sched_runq(struct sched_context *con) * help us get more than one event at one time if they are very * close together. */ - tv = ast_tvadd(ast_tvnow(), ast_tv(0, 1000)); - if (ast_tvcmp(AST_DLLIST_FIRST(&con->schedq)->when, tv) != -1) + when = ast_tvadd(ast_tvnow(), ast_tv(0, 1000)); + if (ast_tvcmp(AST_DLLIST_FIRST(&con->schedq)->when, when) != -1) break; current = AST_DLLIST_REMOVE_HEAD(&con->schedq, list); |