From: cristianrosa Date: Tue, 11 Jan 2011 13:30:36 +0000 (+0000) Subject: Bugfix: no longer post a request in the clean up function. X-Git-Tag: v3.6_beta2~533 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8dafeda30a8f9bbd7f5dd22098c6da09fd1f3e47 Bugfix: no longer post a request in the clean up function. Assume the process being killed is "self". git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9395 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/msg/m_process.c b/src/msg/m_process.c index 2dcb16f81f..ea8faa63f6 100644 --- a/src/msg/m_process.c +++ b/src/msg/m_process.c @@ -28,12 +28,21 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, /******************************** Process ************************************/ void __MSG_process_cleanup(smx_process_t smx_proc) { - /* arg is a pointer to a simix process, we can get the msg process with the field data */ - m_process_t proc = SIMIX_req_process_get_data(smx_proc); + /* This function should be always be executed by the process being + * cleaned up */ + if(smx_proc != SIMIX_process_self()) + THROW_IMPOSSIBLE; + + /* arg is no longer used, just kept to avoid changing the interface */ + m_process_t proc = SIMIX_process_self_get_data(); + #ifdef HAVE_TRACING TRACE_msg_process_end(proc); #endif - xbt_fifo_remove(msg_global->process_list, proc); + + if(msg_global) + xbt_fifo_remove(msg_global->process_list, proc); + SIMIX_process_cleanup(smx_proc); if (proc->name) { free(proc->name);