Fix up a problem that was introduced into the scheduler when it was converted
authorRussell Bryant <russell@russellbryant.com>
Wed, 7 May 2008 21:11:33 +0000 (21:11 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 7 May 2008 21:11:33 +0000 (21:11 +0000)
commit56aa9b9efa1c6f1d34fd1e852d427b7831e339e1
tree00ec8dd5212d50dc50276768ea9f6c2f7c203dc9
parentdecb1c40cf778c420498ac297f37b82054ee20bc
Fix up a problem that was introduced into the scheduler when it was converted
to use doubly linked lists.  The schedule() function had an optimization that
had it try to guess which direction would be better for the traversal to insert
the task into the scheduler queue.  However, if the code chose the path where
it traversed the queue in reverse, and the result was that the task should be
at the head of the queue, then the code would actually put it at the tail,
instead.

(Problem found by bbryant, debugged and fixed by bbryant and me)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/sched.c