"Logging specific to MSG (process)");
/******************************** Process ************************************/
+/** \ingroup m_process_management
+ * \brief Creates and runs a new #m_process_t.
+ *
+ * Does exactly the same as #MSG_process_create_with_arguments but without
+ providing standard arguments (\a argc, \a argv).
+ * \sa MSG_process_create_with_arguments
+ */
+m_process_t MSG_process_create(const char *name,
+ m_process_code_t code, void *data,
+ m_host_t host)
+{
+ return MSG_process_create_with_arguments(name, code, data, host, -1, NULL);
+}
+
+static void MSG_process_cleanup(void *arg)
+{
+ xbt_fifo_remove(msg_global->process_list, arg);
+ xbt_fifo_remove(msg_global->process_to_run, arg);
+ xbt_fifo_remove(((m_process_t) arg)->simdata->host->simdata->process_list, arg);
+ xbt_free(((m_process_t) arg)->name);
+ xbt_free(((m_process_t) arg)->simdata);
+ xbt_free(arg);
+}
+
/** \ingroup m_process_management
* \brief Creates and runs a new #m_process_t.
object. It is for user-level information and can be NULL. It can
be retrieved with the function \ref MSG_process_get_data.
* \param host the location where the new agent is executed.
+ * \param argc first argument passed to \a code
+ * \param argv second argument passed to \a code
* \see m_process_t
* \return The new corresponding object.
*/
-m_process_t MSG_process_create(const char *name,
- m_process_code_t code, void *data,
- m_host_t host)
-{
- return MSG_process_create_with_arguments(name, code, data, host, -1, NULL);
-}
-
-static void MSG_process_cleanup(void *arg)
-{
- xbt_fifo_remove(msg_global->process_list, arg);
- xbt_fifo_remove(msg_global->process_to_run, arg);
- xbt_fifo_remove(((m_process_t) arg)->simdata->host->simdata->process_list, arg);
- xbt_free(((m_process_t) arg)->name);
- xbt_free(((m_process_t) arg)->simdata);
- xbt_free(arg);
-}
-
m_process_t MSG_process_create_with_arguments(const char *name,
m_process_code_t code, void *data,
m_host_t host, int argc, char **argv)
return process;
}
-void MSG_process_free(m_process_t process)
+/** \ingroup m_process_management
+ * \param process poor victim
+ *
+ * This function simply kills a \a process... scarry isn't it ? :)
+ */
+void MSG_process_kill(m_process_t process)
{
xbt_fifo_remove(msg_global->process_list,process);
xbt_context_free(process->simdata->context);
return (((simdata_process_t) process->simdata)->PID);
}
-
/** \ingroup m_process_management
* \brief Returns the process ID of the parent of \a process.
*
return (process->simdata->suspended);
}
-
-
-
-
MSG_error_t __MSG_process_block(void)
{
m_process_t process = MSG_process_self();