Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use std::function for s_smx_process_exit_fun_t.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 1 Jun 2018 12:23:16 +0000 (14:23 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 1 Jun 2018 12:23:16 +0000 (14:23 +0200)
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp

index 96aac00..736e426 100644 (file)
@@ -758,14 +758,14 @@ void SIMIX_process_on_exit_runall(smx_actor_t process) {
   while (not process->on_exit.empty()) {
     s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
     process->on_exit.pop_back();
-    (exit_fun.fun)((void*)exit_status, exit_fun.arg);
+    (exit_fun.fun)(exit_status, exit_fun.arg);
   }
 }
 
 void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data) {
   xbt_assert(process, "current process not found: are you in maestro context ?");
 
-  s_smx_process_exit_fun_t exit_fun = {fun, data};
+  s_smx_process_exit_fun_t exit_fun = {[fun](int a, void* b) { fun((void*)(intptr_t)a, b); }, data};
 
   process->on_exit.push_back(exit_fun);
 }
index 15bfeb0..af2a7f3 100644 (file)
 #include "src/simix/popping_private.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include <boost/intrusive/list.hpp>
+#include <functional>
 #include <list>
 #include <map>
 
 struct s_smx_process_exit_fun_t {
-  int_f_pvoid_pvoid_t fun;
+  std::function<void(int, void*)> fun;
   void *arg;
 };