From: Christian Grothoff Date: Fri, 13 Nov 2009 20:58:20 +0000 (+0000) Subject: set shutdown flag also for ready tasks X-Git-Tag: initial-import-from-subversion-38251~23091 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=89305cdf4f3f0f6f611bbae3a41a2448d2572839;p=oweals%2Fgnunet.git set shutdown flag also for ready tasks --- diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 1df907a20..3f3b14377 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -398,6 +398,7 @@ void GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched) { struct Task *pos; + int i; pos = sched->pending; while (pos != NULL) @@ -408,6 +409,18 @@ GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched) readyness-factors */ pos = pos->next; } + for (i=0;iready[i]; + while (pos != NULL) + { + pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN; + /* we don't move the task into the ready queue yet; check_ready + will do that later, possibly adding additional + readyness-factors */ + pos = pos->next; + } + } }