From: Marion Guthmuller Date: Thu, 3 Jul 2014 13:24:07 +0000 (+0200) Subject: don't destroy detached comm from the sender side during process cleanup X-Git-Tag: v3_12~927 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b83750d410261d5d1831b34937c14a09e9108b8a don't destroy detached comm from the sender side during process cleanup --- diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index 32c7075fe2..f81697360d 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -64,20 +64,12 @@ void SIMIX_process_cleanup(smx_process_t process) action, action->comm.detached, (int)action->state, action->comm.src_proc, action->comm.dst_proc); action->comm.src_proc = NULL; - 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 { + /* I'm not supposed to destroy a detached comm from the sender side, */ + if (!action->comm.detached) SIMIX_comm_destroy(action); - } + else + XBT_DEBUG("Don't destroy it since it's a detached comm"); + } else if (action->comm.dst_proc == process){ XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",