aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-10 16:42:32 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-10 16:42:32 +0000
commit82ce0eba0d151df94c3dbb23d0f0a0f7f435e480 (patch)
tree89421f70ba78f1d9500a5812584338c928c380e4 /main
parent01f98e120f8f04763e599ab8a845b520efde5b59 (diff)
Merged revisions 142355 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r142355 | russell | 2008-09-10 11:41:55 -0500 (Wed, 10 Sep 2008) | 15 lines Merged revisions 142354 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r142354 | russell | 2008-09-10 11:39:53 -0500 (Wed, 10 Sep 2008) | 7 lines It is a normal situation that a task gets put in the scheduler that should run as soon as possible. Accept "0" as an acceptable time to run, and also treat negative as "run now", and don't print a debug message about it. (inspired by a message asking about the "request to schedule in the past" debug message on the -dev list) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@142356 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/sched.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main/sched.c b/main/sched.c
index 88a259b40..0d5968954 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -195,7 +195,6 @@ static int sched_settime(struct timeval *tv, int when)
*tv = now;
*tv = ast_tvadd(*tv, ast_samp2tv(when, 1000));
if (ast_tvcmp(*tv, now) < 0) {
- ast_debug(1, "Request to schedule in the past?!?!\n");
*tv = now;
}
return 0;
@@ -216,11 +215,9 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal
{
struct sched *tmp;
int res = -1;
+
DEBUG(ast_debug(1, "ast_sched_add()\n"));
- if (!when) {
- ast_log(LOG_NOTICE, "Scheduled event in 0 ms?\n");
- return -1;
- }
+
ast_mutex_lock(&con->lock);
if ((tmp = sched_alloc(con))) {
tmp->id = con->eventcnt++;
@@ -242,6 +239,7 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal
ast_sched_dump(con);
#endif
ast_mutex_unlock(&con->lock);
+
return res;
}