]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 273718 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Jul 2010 17:11:38 +0000 (17:11 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Jul 2010 17:11:38 +0000 (17:11 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r273718 | tilghman | 2010-07-02 12:10:59 -0500 (Fri, 02 Jul 2010) | 15 lines

  Merged revisions 273717 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r273717 | tilghman | 2010-07-02 12:09:47 -0500 (Fri, 02 Jul 2010) | 8 lines

    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.6.2@273719 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/autoservice.c

index 0a963097d406df716ffebcb9ed6f695ece4d6bdd..6b9633301131ac5f110d5ac35929fd12cdb45d3b 100644 (file)
@@ -110,6 +110,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;
                }