From 89305cdf4f3f0f6f611bbae3a41a2448d2572839 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 13 Nov 2009 20:58:20 +0000 Subject: [PATCH] set shutdown flag also for ready tasks --- src/util/scheduler.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; + } + } } -- 2.25.1