A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the commit introducing MSG_task_ref by actually introducing it, not only its...
[simgrid.git]
/
src
/
msg
/
task.c
diff --git
a/src/msg/task.c
b/src/msg/task.c
index
60082dc
..
8aae84d
100644
(file)
--- 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;
}
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.
*
/** \ingroup m_task_management
* \brief Return the user data of a #m_task_t.
*
@@
-148,9
+153,7
@@
MSG_error_t MSG_task_destroy(m_task_t task)
action = task->simdata->compute;
if (action)
SIMIX_action_destroy(action);
action = task->simdata->compute;
if (action)
SIMIX_action_destroy(action);
- action = task->simdata->comm;
- if (action)
- SIMIX_action_destroy(action);
+
/* parallel tasks only */
if (task->simdata->host_list)
xbt_free(task->simdata->host_list);
/* parallel tasks only */
if (task->simdata->host_list)
xbt_free(task->simdata->host_list);
@@
-177,11
+180,10
@@
MSG_error_t MSG_task_cancel(m_task_t task)
return MSG_OK;
}
if (task->simdata->comm) {
return MSG_OK;
}
if (task->simdata->comm) {
- SIMIX_
ac
tion_cancel(task->simdata->comm);
+ SIMIX_
communica
tion_cancel(task->simdata->comm);
return MSG_OK;
}
return MSG_OK;
}
-
- return MSG_FATAL;
+ THROW_IMPOSSIBLE;
}
/** \ingroup m_task_management
}
/** \ingroup m_task_management
@@
-223,7
+225,7
@@
double MSG_task_get_remaining_communication(m_task_t task)
xbt_assert0((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
xbt_assert0((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
- return SIMIX_
ac
tion_get_remains(task->simdata->comm);
+ return SIMIX_
communica
tion_get_remains(task->simdata->comm);
}
/** \ingroup m_task_management
}
/** \ingroup m_task_management