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
Remove the 'TUTORIAL: New API' chunks
[simgrid.git]
/
src
/
simix
/
smx_synchro.c
diff --git
a/src/simix/smx_synchro.c
b/src/simix/smx_synchro.c
index
90e0da2
..
22e7180
100644
(file)
--- a/
src/simix/smx_synchro.c
+++ b/
src/simix/smx_synchro.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-201
3
. The SimGrid Team.
+/* Copyright (c) 2007-201
4
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-23,6
+23,7
@@
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);
+
smx_action_t action;
action = xbt_mallocator_get(simix_global->action_mallocator);
action->type = SIMIX_ACTION_SYNCHRO;
smx_action_t action;
action = xbt_mallocator_get(simix_global->action_mallocator);
action->type = SIMIX_ACTION_SYNCHRO;
@@
-70,6
+71,7
@@
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);
+ xbt_assert(action->type == SIMIX_ACTION_SYNCHRO);
surf_action_unref(action->synchro.sleep);
xbt_free(action->name);
xbt_mallocator_release(simix_global->action_mallocator, action);
surf_action_unref(action->synchro.sleep);
xbt_free(action->name);
xbt_mallocator_release(simix_global->action_mallocator, action);
@@
-79,6
+81,7
@@
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);
+ xbt_assert(action->type == SIMIX_ACTION_SYNCHRO);
if (surf_action_get_state(action->synchro.sleep) == SURF_ACTION_FAILED)
action->state = SIMIX_FAILED;
else if(surf_action_get_state(action->synchro.sleep) == SURF_ACTION_DONE)
if (surf_action_get_state(action->synchro.sleep) == SURF_ACTION_FAILED)
action->state = SIMIX_FAILED;
else if(surf_action_get_state(action->synchro.sleep) == SURF_ACTION_DONE)