X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aa9e8fc1b2c24338a883043a363005e6b1a3d619..06aaaaffb5ec865a880e32dcff6768792ce78446:/src/msg/task.c diff --git a/src/msg/task.c b/src/msg/task.c index a54b159114..8aae84d883 100644 --- a/src/msg/task.c +++ b/src/msg/task.c @@ -76,6 +76,11 @@ m_task_t MSG_task_create(const char *name, double compute_duration, return task; } +/** prevent the task from being destroyed too quickly (but also prevent it from being sent). Mainly useful in bindings */ +void MSG_task_ref(m_task_t t) { + t->simdata->refcount++; +} + /** \ingroup m_task_management * \brief Return the user data of a #m_task_t. * @@ -178,8 +183,7 @@ MSG_error_t MSG_task_cancel(m_task_t task) SIMIX_communication_cancel(task->simdata->comm); return MSG_OK; } - - return MSG_FATAL; + THROW_IMPOSSIBLE; } /** \ingroup m_task_management