diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:42:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:42:57 +0000 |
commit | 2d4c97b88bcb0858b16dcd0f48ab68f90ecda96d (patch) | |
tree | 530fb39542c483f10a888a1d07bec061921efb61 /src | |
parent | ce61391973d0326a55cb907bbfa92ba27f2b106b (diff) | |
download | gnunet-2d4c97b88bcb0858b16dcd0f48ab68f90ecda96d.tar.gz gnunet-2d4c97b88bcb0858b16dcd0f48ab68f90ecda96d.zip |
-use flag to check for readyness
Diffstat (limited to 'src')
-rw-r--r-- | src/util/scheduler.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 8bac9e08f..ac4f89a73 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -151,6 +151,11 @@ struct GNUNET_SCHEDULER_Task | |||
151 | */ | 151 | */ |
152 | int lifeness; | 152 | int lifeness; |
153 | 153 | ||
154 | /** | ||
155 | * Is this task in the ready list? | ||
156 | */ | ||
157 | int in_ready_list; | ||
158 | |||
154 | #if EXECINFO | 159 | #if EXECINFO |
155 | /** | 160 | /** |
156 | * Array of strings which make up a backtrace from the point when this | 161 | * Array of strings which make up a backtrace from the point when this |
@@ -416,6 +421,7 @@ queue_ready_task (struct GNUNET_SCHEDULER_Task *task) | |||
416 | GNUNET_CONTAINER_DLL_insert (ready_head[p], | 421 | GNUNET_CONTAINER_DLL_insert (ready_head[p], |
417 | ready_tail[p], | 422 | ready_tail[p], |
418 | task); | 423 | task); |
424 | task->in_ready_list = GNUNET_YES; | ||
419 | ready_count++; | 425 | ready_count++; |
420 | } | 426 | } |
421 | 427 | ||
@@ -899,8 +905,7 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task) | |||
899 | void *ret; | 905 | void *ret; |
900 | 906 | ||
901 | GNUNET_assert (NULL != active_task); | 907 | GNUNET_assert (NULL != active_task); |
902 | if ( (GNUNET_SCHEDULER_REASON_NONE == task->reason) || | 908 | if (! task->in_ready_list) |
903 | (GNUNET_SCHEDULER_REASON_SHUTDOWN == task->reason) ) | ||
904 | { | 909 | { |
905 | if ( (-1 == task->read_fd) && | 910 | if ( (-1 == task->read_fd) && |
906 | (-1 == task->write_fd) && | 911 | (-1 == task->write_fd) && |