Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
implement refcount on sockets since they are somehow shared between sender and receiv...
[simgrid.git] / src / gras / Msg / sg_msg.c
index f82f99a..7f87f66 100644 (file)
@@ -47,7 +47,7 @@ gras_msg_t gras_msg_recv_any(void)
          rdv_client : sock_data->rdv_server, sock_data->comm_recv);
 
 
-    /* The following assert fails in some valid conditions, we need to
+    /* If the following assert fails in some valid conditions, we need to
      * change the code downward looking for the socket again.
      *
      * For now it relies on the facts (A) that sockets and comms are aligned
@@ -97,6 +97,7 @@ gras_msg_t gras_msg_recv_any(void)
   xbt_dynar_get_cpy(comms, got, &(comm));
   msg = SIMIX_communication_get_data(comm);
   VERB1("Got something. Communication %p's over", comm);
+  SIMIX_communication_destroy(comm);
 
   /* Reinstall a waiting communication on that rdv */
   /* Get the sock again
@@ -137,6 +138,7 @@ void gras_msg_send_ext(gras_socket_t sock,
 
   /*initialize gras message */
   msg = xbt_new(s_gras_msg_t, 1);
+  sock->refcount++;
   msg->expe = sock;
   msg->kind = kind;
   msg->type = msgtype;