/** \ingroup m_task_usage * \brief Cancel a #msg_task_t. * \param task the task to cancel. If it was executed or transfered, it stops the process that were working on it. */ msg_error_t MSG_task_cancel(msg_task_t task) { xbt_assert((task != nullptr), "Cannot cancel a nullptr task"); if (task->simdata->compute) { simcall_execution_cancel(task->simdata->compute); } else if (task->simdata->comm) { simdata_task_t simdata = task->simdata; simcall_comm_cancel(simdata->comm); simdata->setNotUsed(); } return MSG_OK; }
/** \ingroup m_task_usage * \brief Cancel a #msg_task_t. * \param task the task to cancel. If it was executed or transfered, it stops the process that were working on it. */ msg_error_t MSG_task_cancel(msg_task_t task) { xbt_assert((task != NULL), "Cannot cancel a NULL task"); if (task->simdata->compute) { simcall_execution_cancel(task->simdata->compute); } else if (task->simdata->comm) { simdata_task_t simdata = task->simdata; simcall_comm_cancel(simdata->comm); if (msg_global->debug_multiple_use && simdata->isused!=0) xbt_ex_free(*(xbt_ex_t*)simdata->isused); simdata->isused = 0; } return MSG_OK; }