]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1330. [bug] When processing events (non-threaded) only allow
authorMark Andrews <marka@isc.org>
Tue, 6 Aug 2002 02:20:39 +0000 (02:20 +0000)
committerMark Andrews <marka@isc.org>
Tue, 6 Aug 2002 02:20:39 +0000 (02:20 +0000)
                        the task one chance to use to use its quantum.

CHANGES
lib/isc/include/isc/types.h
lib/isc/task.c

diff --git a/CHANGES b/CHANGES
index 1f68057148df7ea286eac71f93a80852f1e10161..bd94266a30ca3d3c8bc2dcb39754f843e26ec1f3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -25,6 +25,9 @@
 1334.  [bug]           When signing/verifying rdatasets, duplicate rdatas
                        need to be suppressed.
 
+1330.  [bug]           When processing events (non-threaded) only allow
+                       the task one chance to use to use its quantum.
+
 1327.  [bug]           The validator would incorrectly mark data as insecure
                        when seeing a bogus signature before a correct
                        signature.
index f59ae3cd2289c0d45359e77e943b9f82c056f371..86cc16ae629ef3e2790968ce620a192bf65e8f33 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: types.h,v 1.32 2001/01/09 21:57:42 bwelling Exp $ */
+/* $Id: types.h,v 1.32.2.1 2002/08/06 02:20:39 marka Exp $ */
 
 #ifndef ISC_TYPES_H
 #define ISC_TYPES_H 1
@@ -78,6 +78,7 @@ typedef struct isc_socketevent                isc_socketevent_t;
 typedef struct isc_socketmgr           isc_socketmgr_t;
 typedef struct isc_symtab              isc_symtab_t;
 typedef struct isc_task                        isc_task_t;
+typedef ISC_LIST(isc_task_t)           isc_tasklist_t;
 typedef struct isc_taskmgr             isc_taskmgr_t;
 typedef struct isc_textregion          isc_textregion_t;
 typedef struct isc_time                        isc_time_t;
index c49e866d366a7c04f9135fa0a4f459f82a532ec7..4aa8d0de14c726e7594b790aef31f0904297f602 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: task.c,v 1.85.2.2 2002/04/23 02:28:54 marka Exp $ */
+/* $Id: task.c,v 1.85.2.3 2002/08/06 02:20:39 marka Exp $ */
 
 /*
  * Principal Author: Bob Halley
@@ -111,7 +111,7 @@ struct isc_taskmgr {
        /* Locked by task manager lock. */
        unsigned int                    default_quantum;
        LIST(isc_task_t)                tasks;
-       LIST(isc_task_t)                ready_tasks;
+       isc_tasklist_t                  ready_tasks;
 #ifdef ISC_PLATFORM_USETHREADS
        isc_condition_t                 work_available;
        isc_condition_t                 exclusive_granted;
@@ -726,6 +726,7 @@ dispatch(isc_taskmgr_t *manager) {
        isc_task_t *task;
 #ifndef ISC_PLATFORM_USETHREADS
        unsigned int total_dispatch_count = 0;
+       isc_tasklist_t ready_tasks;
 #endif /* ISC_PLATFORM_USETHREADS */
 
        REQUIRE(VALID_MANAGER(manager));
@@ -780,6 +781,9 @@ dispatch(isc_taskmgr_t *manager) {
         * unlocks.  The while expression is always protected by the lock.
         */
 
+#ifndef ISC_PLATFORM_USETHREADS
+       ISC_LIST_INIT(ready_tasks);
+#endif
        LOCK(&manager->lock);
        while (!FINISHED(manager)) {
 #ifdef ISC_PLATFORM_USETHREADS
@@ -965,11 +969,18 @@ dispatch(isc_taskmgr_t *manager) {
                                 * were usually nonempty, the 'optimization'
                                 * might even hurt rather than help.
                                 */
+#ifdef ISC_PLATFORM_USETHREADS
                                ENQUEUE(manager->ready_tasks, task,
                                        ready_link);
+#else
+                               ENQUEUE(ready_tasks, task, ready_link);
+#endif
                        }
                }
        }
+#ifndef ISC_PLATFORM_USETHREADS
+       ISC_LIST_APPENDLIST(manager->ready_tasks, ready_tasks, ready_link);
+#endif
        UNLOCK(&manager->lock);
 }