From: Lars Magne Ingebrigtsen Date: Mon, 2 May 2011 17:28:34 +0000 (+0200) Subject: (url-queue-run-queue): Pick the first waiting job, and not the last. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=08da93f1a3b99ea81572aeb2e8d0fdfa7b63b0e8;p=emacs.git (url-queue-run-queue): Pick the first waiting job, and not the last. --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 0bf4d09c95c..55b400e2bd7 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,6 +1,8 @@ 2011-05-02 Lars Magne Ingebrigtsen * url-queue.el: New file. + (url-queue-run-queue): Pick the first waiting job, and not the + last. 2011-04-16 Lars Magne Ingebrigtsen diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 2d94d8afea3..d572418e3e2 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el @@ -67,9 +67,11 @@ controls the level of parallelism via the (let ((running 0) waiting) (dolist (entry url-queue) - (if (url-queue-start-time entry) - (incf running) - (setq waiting entry))) + (cond + ((url-queue-start-time entry) + (incf running)) + ((not waiting) + (setq waiting entry)))) (when (and waiting (< running url-queue-parallel-processes)) (setf (url-queue-start-time waiting) (float-time))