Call to set_wakeup added after tasks added/removed to/from pending_timeout
authort3sserakt <t3ss@posteo.de>
Thu, 3 Aug 2017 04:04:45 +0000 (06:04 +0200)
committert3sserakt <t3ss@posteo.de>
Thu, 3 Aug 2017 04:04:45 +0000 (06:04 +0200)
src/util/scheduler.c

index 9061200bd0866919f53eeb8c8b029b9c1655b92a..7fe18bbe68ff15022a87e50135c95f0938ffa4d7 100644 (file)
@@ -539,6 +539,7 @@ check_ready (const struct GNUNET_NETWORK_FDSet *rs,
     GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
                                  pending_timeout_tail,
                                  pos);
+    scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
     if (pending_timeout_last == pos)
       pending_timeout_last = NULL;
     queue_ready_task (pos);
@@ -1131,6 +1132,7 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task)
   GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
              pending_timeout_tail,
              task);
+      scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
       if (task == pending_timeout_last)
         pending_timeout_last = NULL;
     }
@@ -1259,6 +1261,7 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at,
     GNUNET_CONTAINER_DLL_insert (pending_timeout_head,
                                  pending_timeout_tail,
                                  t);
+    scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
   }
   else
   {
@@ -1981,6 +1984,7 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh)
     GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
                                  pending_timeout_tail,
                                  pos);
+    scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
     if (pending_timeout_last == pos)
       pending_timeout_last = NULL;
     queue_ready_task (pos);