gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22460 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r22460 - gnunet/src/testbed
Date: Tue, 3 Jul 2012 15:32:02 +0200

Author: harsha
Date: 2012-07-03 15:32:02 +0200 (Tue, 03 Jul 2012)
New Revision: 22460

Modified:
   gnunet/src/testbed/gnunet-service-testbed.c
Log:
-tracking lcf_proc_task

Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-07-03 13:14:15 UTC (rev 
22459)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-07-03 13:32:02 UTC (rev 
22460)
@@ -225,69 +225,86 @@
 
 
 /**
+ * The master context; generated with the first INIT message
+ */
+static struct Context *master_context;
+
+/***********/
+/* Handles */
+/***********/
+
+/**
  * Wrapped stdin.
  */
 static struct GNUNET_DISK_FileHandle *fh;
 
 /**
- * The master context; generated with the first INIT message
+ * Current Transmit Handle; NULL if no notify transmit exists currently
  */
-static struct Context *master_context;
+static struct GNUNET_SERVER_TransmitHandle *transmit_handle;
 
+/****************/
+/* Lists & Maps */
+/****************/
+
 /**
- * The shutdown task handle
+ * The head for the LCF queue
  */
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct LCFContextQueue *lcfq_head;
 
 /**
- * Array of host list
+ * The tail for the LCF queue
  */
-static struct GNUNET_TESTBED_Host **host_list;
+static struct LCFContextQueue *lcfq_tail;
 
 /**
- * The size of the host list
+ * The message queue head
  */
-static uint32_t host_list_size;
+static struct MessageQueue *mq_head;
 
 /**
- * A list of routes
+ * The message queue tail
  */
-static struct Route **route_list;
+static struct MessageQueue *mq_tail;
 
 /**
- * The size of the route list
+ * Array of host list
  */
-static uint32_t route_list_size;
+static struct GNUNET_TESTBED_Host **host_list;
 
 /**
- * The message queue head
+ * A list of routes
  */
-static struct MessageQueue *mq_head;
+static struct Route **route_list;
 
 /**
- * The message queue tail
+ * The hashmap of shared services
  */
-static struct MessageQueue *mq_tail;
+static struct GNUNET_CONTAINER_MultiHashMap *ss_map;
 
 /**
- * The head for the LCF queue
+ * The size of the host list
  */
-static struct LCFContextQueue *lcfq_head;
+static uint32_t host_list_size;
 
 /**
- * The tail for the LCF queue
+ * The size of the route list
  */
-static struct LCFContextQueue *lcfq_tail;
+static uint32_t route_list_size;
 
+/*********/
+/* Tasks */
+/*********/
+
 /**
- * Current Transmit Handle; NULL if no notify transmit exists currently
+ * The lcf_task handle
  */
-struct GNUNET_SERVER_TransmitHandle *transmit_handle;
+static GNUNET_SCHEDULER_TaskIdentifier lcf_proc_task_id;
 
 /**
- * The hashmap of shared services
+ * The shutdown task handle
  */
-struct GNUNET_CONTAINER_MultiHashMap *ss_map;
+static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
 
 
 /**
@@ -424,19 +441,20 @@
   struct LCFContext *lcf = cls;
 
   lcf->rhandle = NULL;
+  GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
   switch (lcf->state)
   {
   case INIT:
     if (NULL != emsg)
       goto registration_error;
     lcf->state = DELEGATED_HOST_REGISTERED;
-    (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
+    lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
     break;
   case DELEGATED_HOST_REGISTERED:
      if (NULL != emsg)
       goto registration_error;
      lcf->state = SLAVE_HOST_REGISTERED;
-     (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
+     lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
      break;
   default:
     GNUNET_assert (0);                 /* Shouldn't reach here */
@@ -447,7 +465,7 @@
   LOG (GNUNET_ERROR_TYPE_WARNING, 
        "Host registration failed with message: %s\n", emsg);
   lcf->state = FINISHED;
-  (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
+  lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
 }
 
 
@@ -463,6 +481,7 @@
   struct LCFContext *lcf = cls;
   struct LCFContextQueue *lcfq;
 
+  lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK;
   switch (lcf->state)
   {
   case INIT:
@@ -478,7 +497,7 @@
     else
     {
       lcf->state = DELEGATED_HOST_REGISTERED;
-      (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
+      lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
     }
     break;
   case DELEGATED_HOST_REGISTERED:
@@ -494,7 +513,7 @@
     else
     {
       lcf->state = SLAVE_HOST_REGISTERED;
-      (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
+      lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
     }
     break;
   case SLAVE_HOST_REGISTERED:
@@ -511,7 +530,7 @@
     GNUNET_CONTAINER_DLL_remove (lcfq_head, lcfq_tail, lcfq);
     GNUNET_free (lcfq);
     if (NULL != lcfq_head)
-      (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq_head->lcf);
+      lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, 
lcfq_head->lcf);
   }
 }
 
@@ -816,11 +835,12 @@
       (1 == msg->is_subordinate) ? GNUNET_YES : GNUNET_NO;
     lcfq->lcf->state = INIT;
     lcfq->lcf->fcontroller = route->fcontroller;
-    lcfq->lcf->cfg = cfg;
+    lcfq->lcf->cfg = cfg;    
     if (NULL == lcfq_head)
     {
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
       GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq);
-      (void) GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq);
+      lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq);
     }
     else
       GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq);




reply via email to

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