X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/30efde3b7477f9d1e177909d76db4e38034dca40..59378580f8bb437fd2a9ed435f7cad27e76c338f:/src/msg/msg_task.cpp diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index 86ece99590..c971394137 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -216,14 +216,14 @@ 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; + simdata_task_t simdata = task->simdata; + if (simdata->compute) { + simcall_execution_cancel(simdata->compute); + MSG_host_del_task(MSG_process_get_host(MSG_process_self()), task); + } else if (simdata->comm) { simcall_comm_cancel(simdata->comm); - simdata->setNotUsed(); } + simdata->setNotUsed(); return MSG_OK; }