-/**
- * \brief Set the user data of a #m_process_t.
- *
- * This functions checks whether \a process is a valid pointer or not and set the user data associated to \a process if it is possible.
- * \param process SIMIX process
- * \param data User data
- */
-void SIMIX_process_set_data(smx_process_t process, void *data)
+void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+{
+ process->suspended = 1;
+
+ /* If we are suspending another process, and it is waiting on an action,
+ suspend it's action. */
+ if (process != issuer) {
+
+ if (process->waiting_action) {
+
+ switch (process->waiting_action->type) {
+
+ case SIMIX_ACTION_EXECUTE:
+ case SIMIX_ACTION_PARALLEL_EXECUTE:
+ SIMIX_host_execution_suspend(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_COMMUNICATE:
+ SIMIX_comm_suspend(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_SLEEP:
+ SIMIX_process_sleep_suspend(process->waiting_action);
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ }
+ }
+ }
+}
+
+void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
+{
+ xbt_assert((process != NULL), "Invalid parameters");
+
+ process->suspended = 0;
+
+ /* If we are resuming another process, resume the action it was waiting for
+ if any. Otherwise add it to the list of process to run in the next round. */
+ if (process != issuer) {
+
+ if (process->waiting_action) {
+
+ switch (process->waiting_action->type) {
+
+ case SIMIX_ACTION_EXECUTE:
+ case SIMIX_ACTION_PARALLEL_EXECUTE:
+ SIMIX_host_execution_resume(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_COMMUNICATE:
+ SIMIX_comm_resume(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_SLEEP:
+ SIMIX_process_sleep_resume(process->waiting_action);
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ }
+ }
+ else {
+ xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ }
+ }
+}
+
+int SIMIX_process_get_maxpid(void) {
+ return simix_process_maxpid;
+}
+
+int SIMIX_process_count(void)