+
+/**
+ * Calling this function makes the process process to yield. The process
+ * that scheduled it returns from __SIMIX_process_schedule as if nothing
+ * had happened.
+ *
+ * Only the processes can call this function, giving back the control
+ * to the maestro
+ */
+void __SIMIX_process_yield(void)
+{
+ DEBUG1("Yield process '%s'", simix_global->current_process->name);
+ xbt_assert0((simix_global->current_process != simix_global->maestro_process),
+ "You are not supposed to run this function here!");
+
+ SIMIX_context_yield();
+
+ if (simix_global->current_process->iwannadie)
+ SIMIX_context_stop(1);
+}
+
+void __SIMIX_process_schedule(smx_process_t process)
+{
+ DEBUG1("Scheduling context: '%s'", process->name);
+
+ /* save the current process */
+ smx_process_t self = simix_global->current_process;
+
+ /* update the current process */
+ simix_global->current_process = process;
+
+ /* schedule the context */
+ SIMIX_context_schedule(process);
+
+ /* restore the current process to the previously saved process */
+ simix_global->current_process = self;
+}