diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-13 20:58:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-13 20:58:20 +0000 |
commit | 89305cdf4f3f0f6f611bbae3a41a2448d2572839 (patch) | |
tree | ca507594b76cbc5a45e791973abf7d96622201d6 /src/util | |
parent | fb130b29c4d6bccb2ac894d5a4484df642e323e1 (diff) | |
download | gnunet-89305cdf4f3f0f6f611bbae3a41a2448d2572839.tar.gz gnunet-89305cdf4f3f0f6f611bbae3a41a2448d2572839.zip |
set shutdown flag also for ready tasks
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/scheduler.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 | |||
398 | GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched) | 398 | GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched) |
399 | { | 399 | { |
400 | struct Task *pos; | 400 | struct Task *pos; |
401 | int i; | ||
401 | 402 | ||
402 | pos = sched->pending; | 403 | pos = sched->pending; |
403 | while (pos != NULL) | 404 | while (pos != NULL) |
@@ -408,6 +409,18 @@ GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched) | |||
408 | readyness-factors */ | 409 | readyness-factors */ |
409 | pos = pos->next; | 410 | pos = pos->next; |
410 | } | 411 | } |
412 | for (i=0;i<GNUNET_SCHEDULER_PRIORITY_COUNT;i++) | ||
413 | { | ||
414 | pos = sched->ready[i]; | ||
415 | while (pos != NULL) | ||
416 | { | ||
417 | pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN; | ||
418 | /* we don't move the task into the ready queue yet; check_ready | ||
419 | will do that later, possibly adding additional | ||
420 | readyness-factors */ | ||
421 | pos = pos->next; | ||
422 | } | ||
423 | } | ||
411 | } | 424 | } |
412 | 425 | ||
413 | 426 | ||