+void SIMIX_pre_process_resume(smx_simcall_t simcall, smx_process_t process){
+ SIMIX_process_resume(process, simcall->issuer);
+}
+
+void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
+{
+ XBT_IN("process = %p, issuer = %p", process, issuer);
+
+ if(process->context->iwannadie) {
+ XBT_VERB("Ignoring request to suspend a process that is currently dying.");
+ return;
+ }
+
+ if(!process->suspended) return;
+ 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;
+
+ case SIMIX_ACTION_SYNCHRO:
+ /* I cannot resume it now. This is delayed to when the process is rescheduled at
+ * the end of the synchro. */
+ break;
+
+ default:
+ xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d",
+ (int)process->waiting_action->type);
+ }
+ }
+ } else XBT_WARN("Strange. Process %p is trying to resume himself.", issuer);
+
+ XBT_OUT();
+}
+
+int SIMIX_process_get_maxpid(void) {
+ return simix_process_maxpid;
+}
+
+int SIMIX_pre_process_count(smx_simcall_t simcall){
+ return SIMIX_process_count();
+}
+int SIMIX_process_count(void)
+{
+ return xbt_swag_size(simix_global->process_list);
+}
+
+int SIMIX_pre_process_get_PID(smx_simcall_t simcall, smx_process_t self){
+ return SIMIX_process_get_PID(self);
+}
+
+int SIMIX_process_get_PID(smx_process_t self){
+ if (self == NULL)
+ return 0;
+ else
+ return self->pid;
+}
+
+int SIMIX_pre_process_get_PPID(smx_simcall_t simcall, smx_process_t self){
+ return SIMIX_process_get_PPID(self);
+}
+
+int SIMIX_process_get_PPID(smx_process_t self){
+ if (self == NULL)
+ return 0;
+ else
+ return self->ppid;
+}
+
+void* SIMIX_pre_process_self_get_data(smx_simcall_t simcall, smx_process_t self){
+ return SIMIX_process_self_get_data(self);
+}
+
+void* SIMIX_process_self_get_data(smx_process_t self)
+{
+ xbt_assert(self == SIMIX_process_self(), "This is not the current process");
+
+ if (!self) {
+ return NULL;
+ }
+ return SIMIX_process_get_data(self);
+}
+
+void SIMIX_pre_process_set_data(smx_simcall_t simcall, smx_process_t process,
+ void *data){
+ SIMIX_process_set_data(process, data);
+}
+void SIMIX_process_self_set_data(smx_process_t self, void *data)