-/* 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"
{
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;
}
/* 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)
{
/* 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){
*/
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 */
*/
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