X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8a0e2b82a1c0981a84e67f1bb4afb6e16fbf8c3a..9fd6cbc6c3b06f4b09e3c3339ffb3cc8a68f9bfa:/include/simgrid/simix.hpp diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 9943239d5c..9720dc87c4 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -61,9 +61,7 @@ template typename std::result_of::type simcall(F&& code) // conveniently handles the success/failure value for us. typedef typename std::result_of::type R; simgrid::xbt::Result result; - simcall_run_kernel([&]{ - simgrid::xbt::fulfillPromise(result, std::forward(code)); - }); + simcall_run_kernel([&] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }); return result.get(); } @@ -72,16 +70,10 @@ XBT_PUBLIC const std::vector& process_get_runnable(); // What's executed as SIMIX actor code: typedef std::function ActorCode; -// Create ActorCode based on argv: +// Create an ActorCode based on a std::string typedef std::function args)> ActorCodeFactory; -XBT_PUBLIC void register_function(const char* name, ActorCodeFactory factory); - -/** These functions will be called when we detect a deadlock: any remaining process is locked on an action - * - * If these functions manage to unlock some of the processes, then the deadlock will be avoided. - */ -XBT_PUBLIC_DATA simgrid::xbt::signal onDeadlock; +XBT_PUBLIC void register_function(std::string name, ActorCodeFactory factory); } } @@ -97,7 +89,7 @@ XBT_PUBLIC_DATA simgrid::xbt::signal onDeadlock; * std::map* props: properties */ typedef smx_actor_t (*smx_creation_func_t)( - /* name */ const char*, std::function code, + /* name */ std::string, simgrid::simix::ActorCode code, /* userdata */ void*, /* hostname */ sg_host_t, /* props */ std::unordered_map*, @@ -105,8 +97,8 @@ typedef smx_actor_t (*smx_creation_func_t)( XBT_PUBLIC void SIMIX_function_register_process_create(smx_creation_func_t function); -XBT_PUBLIC smx_actor_t simcall_process_create(const char* name, std::function code, void* data, sg_host_t host, - std::unordered_map* properties); +XBT_PUBLIC smx_actor_t simcall_process_create(std::string name, simgrid::simix::ActorCode code, void* data, + sg_host_t host, std::unordered_map* properties); XBT_PUBLIC smx_timer_t SIMIX_timer_set(double date, simgrid::xbt::Task callback);