From 4b5b6ffa27586f4c07cb3e4eb6c672784efa5376 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 10 Sep 2008 16:39:53 +0000 Subject: [PATCH] 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@142354 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/sched.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main/sched.c b/main/sched.c index b11b73a17d..cb60986356 100644 --- a/main/sched.c +++ b/main/sched.c @@ -201,7 +201,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_log(LOG_DEBUG, "Request to schedule in the past?!?!\n"); *tv = now; } return 0; @@ -215,11 +214,9 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal { struct sched *tmp; int res = -1; + DEBUG(ast_log(LOG_DEBUG, "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++; @@ -241,6 +238,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; }