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);
/* 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);
if ((proc = xbt_swag_extract(sem->sleeping))) {
proc = xbt_swag_extract(sem->sleeping);
SIMIX_synchro_destroy(proc->waiting_action);
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);