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
when scheduling the same application more than once, better to free
[simgrid.git]
/
src
/
simix
/
smx_private.h
diff --git
a/src/simix/smx_private.h
b/src/simix/smx_private.h
index
6e151d7
..
257ea0e
100644
(file)
--- a/
src/simix/smx_private.h
+++ b/
src/simix/smx_private.h
@@
-258,7
+258,8
@@
static XBT_INLINE smx_context_t SIMIX_context_new(xbt_main_func_t code,
void_pfn_smxprocess_t cleanup_func,
smx_process_t simix_process)
{
void_pfn_smxprocess_t cleanup_func,
smx_process_t simix_process)
{
-
+ if (!simix_global)
+ xbt_die("simix is not initialized, please call MSG_init first");
return simix_global->context_factory->create_context(code,
argc, argv,
cleanup_func,
return simix_global->context_factory->create_context(code,
argc, argv,
cleanup_func,
@@
-299,7
+300,9
@@
static XBT_INLINE void SIMIX_context_suspend(smx_context_t context)
*/
static XBT_INLINE void SIMIX_context_runall(void)
{
*/
static XBT_INLINE void SIMIX_context_runall(void)
{
- simix_global->context_factory->runall();
+ if (!xbt_dynar_is_empty(simix_global->process_to_run)) {
+ simix_global->context_factory->runall();
+ }
}
/**
}
/**
@@
-310,7
+313,6
@@
static XBT_INLINE smx_context_t SIMIX_context_self(void)
if (simix_global && simix_global->context_factory) {
return simix_global->context_factory->self();
}
if (simix_global && simix_global->context_factory) {
return simix_global->context_factory->self();
}
-
return NULL;
}
return NULL;
}