-smx_activity_t SIMIX_process_suspend(smx_actor_t process, smx_actor_t issuer)
-{
- if (process->suspended) {
- XBT_DEBUG("Process '%s' is already suspended", process->name.c_str());
- return nullptr;
- }
-
- process->suspended = 1;
-
- /* If we are suspending another process that is waiting on a sync, suspend its synchronization. */
- if (process != issuer) {
-
- if (process->waiting_synchro)
- process->waiting_synchro->suspend();
- /* If the other process is not waiting, its suspension is delayed to when the process is rescheduled. */
-
- return nullptr;
- } else {
- return SIMIX_execution_start(process, "suspend", 0.0, 1.0, 0.0);
- }
-}
-
-void SIMIX_process_resume(smx_actor_t process)
-{
- XBT_IN("process = %p", process);
-
- if (process->context->iwannadie) {
- XBT_VERB("Ignoring request to suspend a process that is currently dying.");
- return;
- }
-
- if (not process->suspended)
- return;
- process->suspended = 0;
-
- /* resume the synchronization that was blocking the resumed process. */
- if (process->waiting_synchro)
- process->waiting_synchro->resume();
-
- XBT_OUT();
-}
-