}
if (timeout > 0)
- SIMIX_cond_wait_timeout(cond, h_simdata->mutex, timeout - start_time);
+ SIMIX_cond_wait_timeout(cond, h_simdata->mutex,
+ timeout - start_time + SIMIX_get_clock());
else
- SIMIX_cond_wait(MSG_mailbox_get_cond(mailbox), h_simdata->mutex);
+ SIMIX_cond_wait(cond, h_simdata->mutex);
if (SIMIX_host_get_state(h_simdata->smx_host) == 0) {
SIMIX_mutex_unlock(h_simdata->mutex);
/* Transfer */
/* create SIMIX action to the communication */
t_simdata->comm =
- SIMIX_action_communicate(t_simdata->sender->simdata->m_host->simdata->
- smx_host,
+ SIMIX_action_communicate(t_simdata->sender->simdata->m_host->
+ simdata->smx_host,
process->simdata->m_host->simdata->smx_host,
t->name, t_simdata->message_size,
t_simdata->rate);
}
SIMIX_register_action_to_condition(t_simdata->comm, t_simdata->cond);
// breaking point if asynchrounous
- process->simdata->waiting_task = t;
+ process->simdata->waiting_action = t_simdata->comm;
while (1) {
SIMIX_cond_wait(t_simdata->cond, t_simdata->mutex);
}
SIMIX_unregister_action_to_condition(t_simdata->comm, t_simdata->cond);
- process->simdata->waiting_task = NULL;
+ process->simdata->waiting_action = NULL;
/* for this process, don't need to change in get function */
SIMIX_mutex_unlock(t_simdata->mutex);
SIMIX_mutex_lock(t_simdata->mutex);
- process->simdata->waiting_task = task; // for debugging and status displaying purpose
+ process->simdata->waiting_action = t_simdata->comm; // for debugging and status displaying purpose
if (timeout > 0) {
xbt_ex_t e;
/* verify if the timeout happened and the communication didn't started yet */
if (t_simdata->comm == NULL) {
DEBUG1("Action terminated %s (there was a timeout)", task->name);
- process->simdata->waiting_task = NULL;
+ process->simdata->waiting_action = NULL;
/* remove the task from the mailbox */
MSG_mailbox_remove(mailbox, task);
}
DEBUG1("Action terminated %s", task->name);
- process->simdata->waiting_task = NULL;
+ process->simdata->waiting_action = NULL;
/* if (t_simdata->receiver && t_simdata->receiver->simdata) { /\* receiver still around *\/ */
/* t_simdata->receiver->simdata->waiting_task = NULL; */
/* } */