- process->suspended = 1;
- c = process->cond;
- xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
- SIMIX_action_suspend(act);
- }
- } else if (process->sem) {
- smx_cond_t s;
- xbt_fifo_item_t i;
- smx_action_t act;
-
- process->suspended = 1;
- s = process->sem;
- xbt_fifo_foreach(s->actions, i, act, smx_action_t) {
- SIMIX_action_suspend(act);
- }
- } else {
- process->suspended = 1;
- }
- } else {
- /* process executing, I can create an action and suspend it */
- smx_action_t dummy;
- smx_cond_t cond;
- char name[] = "dummy";
- process->suspended = 1;
-
- cond = SIMIX_cond_init();
- dummy = SIMIX_action_execute(SIMIX_process_get_host(process), name, 0);
- SIMIX_process_self()->waiting_action = dummy;
- SIMIX_action_suspend(dummy);
- SIMIX_register_action_to_condition(dummy, cond);
- __SIMIX_cond_wait(cond);
- SIMIX_process_self()->waiting_action = NULL;
- SIMIX_unregister_action_to_condition(dummy, cond);
- SIMIX_action_destroy(dummy);
- SIMIX_cond_destroy(cond);
- }
- return;