- * In the future, it might be extended in order to attach other threads created by a third party library.
- */
-msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host, xbt_dict_t properties)
-{
- xbt_assert(host != nullptr, "Invalid parameters: host and code params must not be nullptr");
- simdata_process_t simdata = xbt_new0(s_simdata_process_t, 1);
- msg_process_t process;
-
- /* Simulator data for MSG */
- simdata->waiting_action = nullptr;
- simdata->waiting_task = nullptr;
- simdata->m_host = host;
- simdata->data = data;
- simdata->last_errno = MSG_OK;
-
- /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
- process = SIMIX_process_attach(name, simdata, sg_host_get_name(host), properties, nullptr);
- if (!process)
- xbt_die("Could not attach");
- simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
- return process;
-}
-
-/** Detach a process attached with `MSG_process_attach()`
- *
- * This is called when the current process has finished its job.
- * Used in the main thread, it waits for the simulation to finish before returning. When it returns, the other
- * simulated processes and the maestro are destroyed.
- */
-void MSG_process_detach(void)
-{
- SIMIX_process_detach();
-}
-
-/** \ingroup m_process_management
- * \param process poor victim
- *
- * This function simply kills a \a process... scary isn't it ? :)
- */
-void MSG_process_kill(msg_process_t process)
-{
-// /* FIXME: why do we only cancel communication actions? is this useful? */
-// simdata_process_t p_simdata = simcall_process_get_data(process);
-// if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) {
-// simcall_comm_cancel(p_simdata->waiting_task->simdata->comm);
-// }
- simcall_process_kill(process);
-}
-
-/**
-* \brief Wait for the completion of a #msg_process_t.
-*
-* \param process the process to wait for
-* \param timeout wait until the process is over, or the timeout occurs
-*/
-msg_error_t MSG_process_join(msg_process_t process, double timeout){
- simcall_process_join(process, timeout);
- return MSG_OK;
-}
-
-/** \ingroup m_process_management
- * \brief Migrates a process to another location.
- *
- * This function checks whether \a process and \a host are valid pointers and change the value of the #msg_host_t on
- * which \a process is running.
- */
-msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
-{
- simdata_process_t simdata = (simdata_process_t) simcall_process_get_data(process);
- simdata->m_host = host;
- msg_host_t now = simdata->m_host;
- TRACE_msg_process_change_host(process, now, host);
- simcall_process_set_host(process, host);
- return MSG_OK;
-}
-
-/** \ingroup m_process_management
- * \brief Returns the user data of a process.
- *
- * This function checks whether \a process is a valid pointer and returns the user data associated to this process.