A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'v3_9_90' into hypervisor
[simgrid.git]
/
src
/
simix
/
smx_synchro.c
diff --git
a/src/simix/smx_synchro.c
b/src/simix/smx_synchro.c
index
c9d14d0
..
f05cdca
100644
(file)
--- a/
src/simix/smx_synchro.c
+++ b/
src/simix/smx_synchro.c
@@
-23,14
+23,16
@@
static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
static smx_action_t SIMIX_synchro_wait(smx_host_t smx_host, double timeout)
{
XBT_IN("(%p, %f)",smx_host,timeout);
static smx_action_t SIMIX_synchro_wait(smx_host_t smx_host, double timeout)
{
XBT_IN("(%p, %f)",smx_host,timeout);
+ surf_model_t ws_model = surf_resource_model(smx_host, SURF_WKS_LEVEL);
+
smx_action_t action;
action = xbt_mallocator_get(simix_global->action_mallocator);
action->type = SIMIX_ACTION_SYNCHRO;
action->name = xbt_strdup("synchro");
action->synchro.sleep =
smx_action_t action;
action = xbt_mallocator_get(simix_global->action_mallocator);
action->type = SIMIX_ACTION_SYNCHRO;
action->name = xbt_strdup("synchro");
action->synchro.sleep =
-
surf_workstation
_model->extension.workstation.sleep(smx_host, timeout);
+
ws
_model->extension.workstation.sleep(smx_host, timeout);
-
surf_workstation
_model->action_data_set(action->synchro.sleep, action);
+
ws
_model->action_data_set(action->synchro.sleep, action);
XBT_OUT();
return action;
}
XBT_OUT();
return action;
}
@@
-70,7
+72,9
@@
void SIMIX_synchro_destroy(smx_action_t action)
{
XBT_IN("(%p)",action);
XBT_DEBUG("Destroying synchro %p", action);
{
XBT_IN("(%p)",action);
XBT_DEBUG("Destroying synchro %p", action);
- action->synchro.sleep->model_type->action_unref(action->synchro.sleep);
+ xbt_assert(action->type == SIMIX_ACTION_SYNCHRO);
+
+ action->synchro.sleep->model_obj->action_unref(action->synchro.sleep);
xbt_free(action->name);
xbt_mallocator_release(simix_global->action_mallocator, action);
XBT_OUT();
xbt_free(action->name);
xbt_mallocator_release(simix_global->action_mallocator, action);
XBT_OUT();
@@
-79,9
+83,12
@@
void SIMIX_synchro_destroy(smx_action_t action)
void SIMIX_post_synchro(smx_action_t action)
{
XBT_IN("(%p)",action);
void SIMIX_post_synchro(smx_action_t action)
{
XBT_IN("(%p)",action);
- if (surf_workstation_model->action_state_get(action->synchro.sleep) == SURF_ACTION_FAILED)
+ xbt_assert(action->type == SIMIX_ACTION_SYNCHRO);
+ surf_model_t ws_model = action->synchro.sleep->model_obj;
+
+ if (ws_model->action_state_get(action->synchro.sleep) == SURF_ACTION_FAILED)
action->state = SIMIX_FAILED;
action->state = SIMIX_FAILED;
- else if(
surf_workstation
_model->action_state_get(action->synchro.sleep) == SURF_ACTION_DONE)
+ else if(
ws
_model->action_state_get(action->synchro.sleep) == SURF_ACTION_DONE)
action->state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(action);
action->state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(action);