X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c529a2898e4b141aa20eaf1561ff8afb5e0cc259..19759270d7d4b85df2dd599fe8936278d840780a:/src/simix/smx_private.hpp diff --git a/src/simix/smx_private.hpp b/src/simix/smx_private.hpp index a0d704aa9b..255105fca2 100644 --- a/src/simix/smx_private.hpp +++ b/src/simix/smx_private.hpp @@ -9,25 +9,7 @@ #include #include "smx_private.h" - -/** - * \brief creates a new context for a user level process - * \param code a main function - * \param argc the number of arguments of the main function - * \param argv the vector of arguments of the main function - * \param cleanup_func the function to call when the context stops - * \param cleanup_arg the argument of the cleanup_func function - */ -static inline smx_context_t SIMIX_context_new(xbt_main_func_t code, - int argc, char **argv, - 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, simix_process); -} +#include "src/simix/popping_private.h" /** * \brief destroy a context @@ -96,6 +78,15 @@ XBT_PRIVATE ContextFactory* sysv_factory(); XBT_PRIVATE ContextFactory* raw_factory(); XBT_PRIVATE ContextFactory* boost_factory(); +template inline +R simcall(e_smx_simcall_t call, Args&&... args) +{ + smx_process_t self = SIMIX_process_self(); + marshal(&self->simcall, call, std::forward(args)...); + simcall_call(self); + return unmarshal(self->simcall.result); +} + } }