Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the commit introducing MSG_task_ref by actually introducing it, not only its...
[simgrid.git] / src / msg / task.c
index 8dd6016..8aae84d 100644 (file)
  *  <em>message size</em> and some <em>private data</em>.
  */
 
-#ifdef HAVE_RUBY /* FIXME: KILLME */
-XBT_LOG_EXTERNAL_CATEGORY(ruby);
-#endif
-
 /********************************* Task **************************************/
 /** \ingroup m_task_management
  * \brief Creates a new #m_task_t.
@@ -77,13 +73,14 @@ m_task_t MSG_task_create(const char *name, double compute_duration,
   simdata->comp_amount = NULL;
   simdata->comm_amount = NULL;
 
-#ifdef HAVE_RUBY /* FIXME: KILLME */
-  CINFO2(ruby,"Created task %p: %s",task,name);
-#endif
-
   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.
  *
@@ -186,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