X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ee63a4fbf0d79259eb0e1e7c5b7053f4b99c7a75..cfabbb6291efb5ef59d78d1751c5f770ef128637:/src/msg/msg_gos.cpp diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 426f25aa5f..5329078ccb 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -1,9 +1,9 @@ -/* Copyright (c) 2004-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "src/simix/smx_private.h" /* MSG_task_listen looks inside the rdv directly. Not clean. */ #include "msg_private.h" #include "mc/mc.h" #include "xbt/log.h" @@ -44,8 +44,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) { xbt_ex_t e; simdata_task_t simdata = task->simdata; - msg_process_t self = SIMIX_process_self(); - simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(self); + simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(); e_smx_state_t comp_state; msg_error_t status = MSG_OK; @@ -285,7 +284,7 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d } /* Internal function used to factorize code between MSG_task_isend_with_matching() and MSG_task_dsend(). */ -static XBT_INLINE msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *alias, +static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *alias, int (*match_fun)(void*,void*, smx_synchro_t), void *match_data, void_f_pvoid_t cleanup, int detached) { @@ -297,7 +296,7 @@ static XBT_INLINE msg_comm_t MSG_task_isend_internal(msg_task_t task, const char /* Prepare the task to send */ t_simdata = task->simdata; t_simdata->sender = process; - t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host; + t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data())->m_host; if (t_simdata->isused != 0) { if (msg_global->debug_multiple_use){ @@ -462,7 +461,7 @@ msg_comm_t MSG_task_irecv(msg_task_t *task, const char *name) */ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rate) { - smx_rdv_t rdv = MSG_mailbox_get_by_alias(name); + smx_mailbox_t rdv = MSG_mailbox_get_by_alias(name); /* FIXME: these functions are not traceable */ /* Sanity check */ @@ -826,7 +825,8 @@ msg_error_t MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alia */ int MSG_task_listen(const char *alias) { - return !MSG_mailbox_is_empty(MSG_mailbox_get_by_alias(alias)); + smx_mailbox_t rdv = MSG_mailbox_get_by_alias(alias); + return !MSG_mailbox_is_empty(rdv) || (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0); } /** \ingroup msg_task_usage