From: Tilghman Lesher Date: Fri, 2 Jul 2010 17:09:47 +0000 (+0000) Subject: Autoservice loop optimization causes a busy loop, when channels are serviced while... X-Git-Tag: 1.4.35-rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01af082769ab51b911aebfbf995d6e313eba7642;p=thirdparty%2Fasterisk.git Autoservice loop optimization causes a busy loop, when channels are serviced while in hangup. (closes issue #17564) Reported by: ramonpeek Patches: 20100630__issue17564.diff.txt uploaded by tilghman (license 14) Tested by: ramonpeek git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@273717 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/autoservice.c b/main/autoservice.c index e82998a44f..e5f1837351 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -115,6 +115,11 @@ static void *autoservice_run(void *ign) AST_LIST_UNLOCK(&aslist); if (!x) { + /* If we don't sleep, this becomes a busy loop, which causes + * problems when Asterisk runs at a different priority than other + * user processes. As long as we check for new channels at least + * once every 10ms, we should be fine. */ + usleep(10000); continue; }