Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use homogeneous dictionaries whenever possible.
[simgrid.git] / src / simix / smx_network.c
index 56f4086..9f98857 100644 (file)
@@ -26,7 +26,7 @@ static void SIMIX_rdv_free(void *data);
 
 void SIMIX_network_init(void)
 {
-  rdv_points = xbt_dict_new();
+  rdv_points = xbt_dict_new_homogeneous(SIMIX_rdv_free);
 }
 
 void SIMIX_network_exit(void)
@@ -49,7 +49,7 @@ smx_rdv_t SIMIX_rdv_create(const char *name)
     rdv->comm_fifo = xbt_fifo_new();
 
     if (rdv->name)
-      xbt_dict_set(rdv_points, rdv->name, rdv, SIMIX_rdv_free);
+      xbt_dict_set(rdv_points, rdv->name, rdv, NULL);
   }
   return rdv;
 }
@@ -554,7 +554,7 @@ XBT_INLINE void SIMIX_comm_start(smx_action_t action)
  */
 void SIMIX_comm_finish(smx_action_t action)
 {
-  unsigned int destroy_count = 0;
+  volatile unsigned int destroy_count = 0;
   smx_req_t req;
 
   while ((req = xbt_fifo_shift(action->request_list))) {
@@ -668,6 +668,7 @@ void SIMIX_comm_finish(smx_action_t action)
     }
 
     req->issuer->waiting_action = NULL;
+    xbt_fifo_remove(req->issuer->comms, action);
     SIMIX_request_answer(req);
     destroy_count++;
   }
@@ -887,7 +888,7 @@ void SIMIX_comm_copy_data(smx_action_t comm)
   if (buff_size == 0)
     return;
 
-  (*SIMIX_comm_copy_data_callback) (comm, buff_size);
+  SIMIX_comm_copy_data_callback(comm, buff_size);
 
   /* Set the copied flag so we copy data only once */
   /* (this function might be called from both communication ends) */