FILE *action_fp;
-xbt_dict_t action_funs;
-xbt_dict_t action_queues;
+xbt_dict_t action_funs = NULL;
+xbt_dict_t action_queues = NULL;
static char *action_line = NULL;
static size_t action_len = 0;
xbt_free(lowername);
}
-void _xbt_replay_action_init(void)
+/** @brief Initializes the replay mechanism, and returns true if (and only if) it was necessary
+ *
+ * It returns false if it was already done by another process.
+ */
+int _xbt_replay_action_init(void)
{
+ if (action_funs)
+ return 0;
is_replay_active = 1;
action_funs = xbt_dict_new_homogeneous(NULL);
action_queues = xbt_dict_new_homogeneous(NULL);
+ return 1;
}
void _xbt_replay_action_exit(void)
xbt_dict_free(&action_queues);
xbt_dict_free(&action_funs);
free(action_line);
+ action_queues = NULL;
+ action_funs = NULL;
+ action_line = NULL;
}
/**
function((const char **)evt);
}
CATCH(e) {
- XBT_ERROR("Replay error :\n %s"
+ free(evt);
+ xbt_die("Replay error :\n %s"
, e.msg);
- xbt_ex_free(e);
- RETHROW;
}
for (i=0;evt[i]!= NULL;i++)
free(evt[i]);