From: cristianrosa Date: Mon, 31 Jan 2011 16:21:54 +0000 (+0000) Subject: Make SIMIX_req_comm(test/wait/testany/waitany) requests to destroy the comm actions. X-Git-Tag: v3.6_beta2~391 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8a7a5f10297e28c98d9c77e2985e96627a43e95e?ds=sidebyside Make SIMIX_req_comm(test/wait/testany/waitany) requests to destroy the comm actions. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9538 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/msg/gos.c b/src/msg/gos.c index 8093c97664..aefe0ec344 100644 --- a/src/msg/gos.c +++ b/src/msg/gos.c @@ -604,7 +604,7 @@ void MSG_comm_destroy(msg_comm_t comm) } /* FIXME auto-destroy comms from SIMIX to avoid this request */ - SIMIX_req_comm_destroy(comm->s_comm); + /*SIMIX_req_comm_destroy(comm->s_comm);*/ free(comm); } diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index 07e19c4534..194c133aea 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -118,7 +118,7 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task, xbt_ex_free(e); } if (comm != NULL) { - SIMIX_req_comm_destroy(comm); + //SIMIX_req_comm_destroy(comm); } if (ret != MSG_HOST_FAILURE && @@ -193,7 +193,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, } if (comm != NULL) { - SIMIX_req_comm_destroy(comm); + //SIMIX_req_comm_destroy(comm); } process->simdata->waiting_task = NULL; diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 113b9d6981..a5868d1fdd 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -508,6 +508,7 @@ static XBT_INLINE void SIMIX_comm_start(smx_action_t action) void SIMIX_comm_finish(smx_action_t action) { + unsigned int destroy_count = 0; smx_req_t req; while ((req = xbt_fifo_shift(action->request_list))) { @@ -606,7 +607,11 @@ void SIMIX_comm_finish(smx_action_t action) req->issuer->waiting_action = NULL; SIMIX_request_answer(req); + destroy_count++; } + + while(destroy_count-- > 0) + SIMIX_comm_destroy(action); } void SIMIX_post_comm(smx_action_t action)