+ return process->suspended;
+}
+
+xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
+{
+ return process->properties;
+}
+
+void SIMIX_pre_process_sleep(smx_req_t req)
+{
+ if (MC_IS_ENABLED) {
+ MC_process_clock_add(req->issuer, req->process_sleep.duration);
+ req->process_sleep.result = SIMIX_DONE;
+ SIMIX_request_answer(req);
+ return;
+ }
+ smx_action_t action = SIMIX_process_sleep(req->issuer, req->process_sleep.duration);
+ xbt_fifo_push(action->request_list, req);
+ req->issuer->waiting_action = action;
+}
+
+smx_action_t SIMIX_process_sleep(smx_process_t process, double duration)
+{
+ smx_action_t action;
+ smx_host_t host = process->smx_host;
+
+ /* check if the host is active */
+ if (surf_workstation_model->extension.
+ workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+ THROWF(host_error, 0, "Host %s failed, you cannot call this function",
+ host->name);
+ }
+
+ action = xbt_mallocator_get(simix_global->action_mallocator);
+ action->type = SIMIX_ACTION_SLEEP;
+ action->name = NULL;
+#ifdef HAVE_TRACING
+ action->category = NULL;
+#endif
+
+ action->sleep.host = host;
+ action->sleep.surf_sleep =
+ surf_workstation_model->extension.workstation.sleep(host->host, duration);
+
+ surf_workstation_model->action_data_set(action->sleep.surf_sleep, action);
+ XBT_DEBUG("Create sleep action %p", action);
+
+ return action;
+}
+
+void SIMIX_post_process_sleep(smx_action_t action)
+{
+ smx_req_t req;
+ e_smx_state_t state;
+
+ while ((req = xbt_fifo_shift(action->request_list))) {
+
+ switch(surf_workstation_model->action_state_get(action->sleep.surf_sleep)){
+ case SURF_ACTION_FAILED:
+ state = SIMIX_SRC_HOST_FAILURE;
+ break;
+
+ case SURF_ACTION_DONE:
+ state = SIMIX_DONE;
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ break;
+ }
+ req->process_sleep.result = state;
+ req->issuer->waiting_action = NULL;
+ SIMIX_request_answer(req);
+ }
+ SIMIX_process_sleep_destroy(action);
+}