action->name = xbt_strdup("synchro");
action->synchro.sleep =
surf_workstation_model->extension.workstation.sleep(smx_host->host, timeout);
action->name = xbt_strdup("synchro");
action->synchro.sleep =
surf_workstation_model->extension.workstation.sleep(smx_host->host, timeout);
else if(surf_workstation_model->action_state_get(action->synchro.sleep) == SURF_ACTION_DONE)
action->state = SIMIX_SRC_TIMEOUT;
else if(surf_workstation_model->action_state_get(action->synchro.sleep) == SURF_ACTION_DONE)
action->state = SIMIX_SRC_TIMEOUT;
/* If there is a mutex unlock it */
/* FIXME: what happens if the issuer is not the owner of the mutex? */
/* If there is a mutex unlock it */
/* FIXME: what happens if the issuer is not the owner of the mutex? */
/* If there are processes waiting for the condition choose one and try
to make it acquire the mutex */
/* If there are processes waiting for the condition choose one and try
to make it acquire the mutex */
if ((proc = xbt_swag_extract(sem->sleeping))) {
proc = xbt_swag_extract(sem->sleeping);
SIMIX_synchro_destroy(proc->waiting_action);
proc->waiting_action = NULL;
if ((proc = xbt_swag_extract(sem->sleeping))) {
proc = xbt_swag_extract(sem->sleeping);
SIMIX_synchro_destroy(proc->waiting_action);
proc->waiting_action = NULL;
if (sem->value <= 0) {
sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
xbt_fifo_unshift(sync_act->request_list, req);
if (sem->value <= 0) {
sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
xbt_fifo_unshift(sync_act->request_list, req);