diff options
author | t3sserakt <t3ss@posteo.de> | 2017-08-08 18:30:33 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2017-08-08 18:30:33 +0200 |
commit | b1e413857618caed22d882da06d38bde79592d02 (patch) | |
tree | 0982eef1ec2b5a54073a47cc8a9fcd4abf024e4f /src/util/scheduler.c | |
parent | b60af34ef8ec413af4eea572ce211ab03a79ca17 (diff) | |
download | gnunet-b1e413857618caed22d882da06d38bde79592d02.tar.gz gnunet-b1e413857618caed22d882da06d38bde79592d02.zip |
Smaller changes. Changed order when set_wakeup is called after some task is removed from pending_timeout
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 42309c199..e90763fb4 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -536,13 +536,15 @@ check_ready (const struct GNUNET_NETWORK_FDSet *rs, | |||
536 | pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; | 536 | pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; |
537 | if (0 == pos->reason) | 537 | if (0 == pos->reason) |
538 | break; | 538 | break; |
539 | scheduler_driver->set_wakeup (scheduler_driver->cls, | 539 | |
540 | pending_timeout_head->timeout); | ||
541 | GNUNET_CONTAINER_DLL_remove (pending_timeout_head, | 540 | GNUNET_CONTAINER_DLL_remove (pending_timeout_head, |
542 | pending_timeout_tail, | 541 | pending_timeout_tail, |
543 | pos); | 542 | pos); |
544 | if (pending_timeout_last == pos) | 543 | if (pending_timeout_last == pos) |
545 | pending_timeout_last = NULL; | 544 | pending_timeout_last = NULL; |
545 | else | ||
546 | scheduler_driver->set_wakeup (scheduler_driver->cls, | ||
547 | pending_timeout_head->timeout); | ||
546 | queue_ready_task (pos); | 548 | queue_ready_task (pos); |
547 | } | 549 | } |
548 | pos = pending_head; | 550 | pos = pending_head; |
@@ -1080,6 +1082,7 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task) | |||
1080 | scheduler_driver->set_wakeup (scheduler_driver->cls, | 1082 | scheduler_driver->set_wakeup (scheduler_driver->cls, |
1081 | pending_timeout_head->timeout); | 1083 | pending_timeout_head->timeout); |
1082 | } | 1084 | } |
1085 | //TODO check if this is redundant | ||
1083 | if (task == pending_timeout_last) | 1086 | if (task == pending_timeout_last) |
1084 | pending_timeout_last = NULL; | 1087 | pending_timeout_last = NULL; |
1085 | } | 1088 | } |
@@ -1920,9 +1923,12 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) | |||
1920 | GNUNET_CONTAINER_DLL_remove (pending_timeout_head, | 1923 | GNUNET_CONTAINER_DLL_remove (pending_timeout_head, |
1921 | pending_timeout_tail, | 1924 | pending_timeout_tail, |
1922 | pos); | 1925 | pos); |
1923 | scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout); | 1926 | |
1924 | if (pending_timeout_last == pos) | 1927 | if (pending_timeout_last == pos) |
1925 | pending_timeout_last = NULL; | 1928 | pending_timeout_last = NULL; |
1929 | else | ||
1930 | scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout); | ||
1931 | |||
1926 | queue_ready_task (pos); | 1932 | queue_ready_task (pos); |
1927 | } | 1933 | } |
1928 | 1934 | ||