From: Samuel Lepetit Date: Wed, 20 Jun 2012 14:14:02 +0000 (+0200) Subject: Stop doing evil things in MSG_parallel_task_execute/MSG_process_sleep X-Git-Tag: v3_8~548^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/072d9299b7554f29522d3d1c9a8b1b5f34e06f26 Stop doing evil things in MSG_parallel_task_execute/MSG_process_sleep --- diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index 0b3a878700..89417a5137 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -96,6 +96,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task) simdata_task_t simdata = NULL; simdata_process_t p_simdata; e_smx_state_t comp_state; + MSG_error_t status = MSG_OK; simdata = task->simdata; @@ -152,13 +153,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task) CATCH(e) { switch (e.category) { case host_error: - /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */ - simdata->comm = NULL; - simdata->compute = NULL; - #ifdef HAVE_TRACING - TRACE_msg_task_execute_end(task); - #endif - MSG_RETURN(MSG_HOST_FAILURE); + status = MSG_HOST_FAILURE; break; case cancel_error: /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */ @@ -167,7 +162,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task) #ifdef HAVE_TRACING TRACE_msg_task_execute_end(task); #endif - MSG_RETURN(MSG_TASK_CANCELED); + status = MSG_TASK_CANCELED; break; default: RETHROW; @@ -182,7 +177,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task) TRACE_msg_task_execute_end(task); #endif - MSG_RETURN(MSG_OK); + MSG_RETURN(status); } @@ -196,6 +191,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task) MSG_error_t MSG_process_sleep(double nb_sec) { xbt_ex_t e; + MSG_error_t status = MSG_OK; /*m_process_t proc = MSG_process_self();*/ #ifdef HAVE_TRACING @@ -219,17 +215,18 @@ MSG_error_t MSG_process_sleep(double nb_sec) #ifdef HAVE_TRACING TRACE_msg_process_sleep_out(MSG_process_self()); #endif - MSG_RETURN(MSG_HOST_FAILURE); - break; + status = MSG_HOST_FAILURE; + break; default: RETHROW; } xbt_ex_free(e); } + #ifdef HAVE_TRACING TRACE_msg_process_sleep_out(MSG_process_self()); #endif - MSG_RETURN(MSG_OK); + MSG_RETURN(status); } /** \ingroup msg_task_usage