gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 11/45: Smaller changes. Changed order when set_wak


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 11/45: Smaller changes. Changed order when set_wakeup is called after some task is removed from pending_timeout
Date: Sun, 31 Dec 2017 00:36:58 +0100

This is an automated email from the git hooks/post-receive script.

lurchi pushed a commit to branch master
in repository gnunet.

commit b1e413857618caed22d882da06d38bde79592d02
Author: t3sserakt <address@hidden>
AuthorDate: Tue Aug 8 18:30:33 2017 +0200

    Smaller changes. Changed order when set_wakeup is called after some task is 
removed from pending_timeout
---
 src/util/scheduler.c | 12 +++++++++---
 1 file 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,
       pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT;
     if (0 == pos->reason)
       break;
-    scheduler_driver->set_wakeup (scheduler_driver->cls,
-                                  pending_timeout_head->timeout);
+
     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);
   }
   pos = pending_head;
@@ -1080,6 +1082,7 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task 
*task)
           scheduler_driver->set_wakeup (scheduler_driver->cls,
                                         pending_timeout_head->timeout);
       }
+      //TODO check if this is redundant
       if (task == pending_timeout_last)
         pending_timeout_last = NULL;
     }
@@ -1920,9 +1923,12 @@ 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;
+    else
+      
scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
+
     queue_ready_task (pos);
   }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]