]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 118: fix race condition for scheduled batch send coordination
authorLee Howard <faxguy@howardsilvan.com>
Mon, 25 Jul 2005 22:16:33 +0000 (22:16 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Mon, 25 Jul 2005 22:16:33 +0000 (22:16 +0000)
CHANGES
faxd/faxQueueApp.c++

diff --git a/CHANGES b/CHANGES
index f5724ec380ab9b65337bda8933d6616fe678fa31..dafa89fa78590caebb2cd2d456052b74eeaeb462 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changelog for HylaFAX 4.2.2
 
+* fix a race with scheduled jobs to allow for coordinated
+  batch sending (25 Jul 2005)
 * fix some error conditions with JBIG and JPEG reception (25 Jul 2005)
 * improve probemodem results for some modems (16 Jul 2005)
 * correct cover sheet page count for some PDFs (14 Jul 2005)
index 4b57ba553fd83e08e3543faa7f75fa421dd27811..ca3398496eb0493ffe19370b397e234065c9be11 100644 (file)
@@ -1586,7 +1586,7 @@ faxQueueApp::sendJobDone(Job& job, FaxRequest* req)
  */
 
 /*
- * Insert a job in the queue of read-to-run jobs.
+ * Insert a job in the queue of ready-to-run jobs.
  */
 void
 faxQueueApp::setReadyToRun(Job& job)
@@ -2097,6 +2097,13 @@ faxQueueApp::runJob(Job& job)
 {
     job.remove();
     setReadyToRun(job);
+    /*
+     * In order to deliberately batch jobs by using a common
+     * time-to-send we need to give time for the other jobs'
+     * timers to expire and to enter the run queue before
+     * running the scheduler.
+     */
+    sleep(1);                  // is this long enough?
     pokeScheduler();
 }