-/**
- * \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_pre_process_suspend(smx_req_t req)
+{
+ smx_process_t process = req->process_suspend.process;
+ SIMIX_process_suspend(process, req->issuer);
+
+ if (process != req->issuer) {
+ SIMIX_request_answer(req);
+ }
+ /* If we are suspending ourselves, then just do not replay the request. */
+}
+
+void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+{
+ xbt_assert0(process, "Invalid parameters");
+
+ 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)