Merge branch 'refactoring-scheduler' of ssh://gnunet.org/gnunet
authorlurchi <lurchi@strangeplace.net>
Tue, 8 Aug 2017 16:42:02 +0000 (18:42 +0200)
committerlurchi <lurchi@strangeplace.net>
Tue, 8 Aug 2017 16:42:02 +0000 (18:42 +0200)
1  2 
src/util/scheduler.c

index 7cd42dcea485e99fa32b461c89b1caf517c830e5,e90763fb449ee5add409652a8571c897c636d3e7..68143d051e6a899d4fa0f055325b220138c8ace1
@@@ -808,8 -1080,9 +808,9 @@@ GNUNET_SCHEDULER_cancel (struct GNUNET_
            pending_timeout_last = NULL;
          else
            scheduler_driver->set_wakeup (scheduler_driver->cls,
 -                                        pending_timeout_head->timeout);
 +                                        get_timeout ());
        }
+       //TODO check if this is redundant
        if (task == pending_timeout_last)
          pending_timeout_last = NULL;
      }
@@@ -1663,8 -1923,12 +1664,11 @@@ GNUNET_SCHEDULER_run_from_driver (struc
      GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
                                   pending_timeout_tail,
                                   pos);
 -
      if (pending_timeout_last == pos)
        pending_timeout_last = NULL;
+     else
+       scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
      queue_ready_task (pos);
    }