X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2f810149832a2d855c33d0df5b02d736c2081e41..cdcfa50107cc897b89de650afa5c7447c21d87d3:/src/simix/smx_process.c diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index dcdadd2b04..f45d326155 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -41,8 +41,9 @@ void SIMIX_process_cleanup(smx_process_t process) smx_action_t action; while ((action = xbt_fifo_pop(process->comms))) { - /* make sure no one will finish the comm after this process is destroyed */ - SIMIX_comm_cancel(action); + /* make sure no one will finish the comm after this process is destroyed (unless it's detached) */ + if (!action->comm.detached || action->comm.src_proc != process) + SIMIX_comm_cancel(action); if (action->comm.src_proc == process) { XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", @@ -51,13 +52,14 @@ void SIMIX_process_cleanup(smx_process_t process) if (action->comm.detached) { if (action->comm.refcount == 0) { + XBT_DEBUG("Increase the refcount before destroying it since it's detached"); /* I'm not supposed to destroy a detached comm from the sender side, * unless there is no receiver matching the rdv */ action->comm.refcount++; SIMIX_comm_destroy(action); } - } - else { + XBT_DEBUG("Don't destroy it since its refcount is %d",action->comm.refcount); + } else { SIMIX_comm_destroy(action); } }