- xbt_swag_remove(arg,
- ((smx_process_t) arg)->simdata->smx_host->simdata->
- process_list);
- free(((smx_process_t) arg)->name);
- ((smx_process_t) arg)->name = NULL;
-
- free(((smx_process_t) arg)->simdata);
- ((smx_process_t) arg)->simdata = NULL;
- free(arg);
+ xbt_swag_remove(arg, simix_global->process_list);
+ xbt_swag_remove(arg, ((smx_process_t)arg)->smx_host->process_list);
+ xbt_swag_insert(arg, simix_global->process_to_destroy);
+}
+
+
+/**
+ * \brief Creates and runs the maestro process
+ *
+ */
+
+void __SIMIX_create_maestro_process()
+{
+ smx_process_t process = NULL;
+ process = xbt_new0(s_smx_process_t, 1);
+
+ /* Process data */
+ process->name = (char *)"maestro";
+
+ /*Create the right context type (FIXME: check the return value for success)*/
+ SIMIX_context_create_maestro(&process);
+
+ /* Set it as the maestro process */
+ simix_global->maestro_process = process;
+ simix_global->current_process = process;
+
+ return;