Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Dexbtization: remove xbt_dynar_t argument in simcall_comm_waitany
[simgrid.git] / src / simix / popping_bodies.cpp
index 5a5ef80..f830047 100644 (file)
@@ -13,6 +13,7 @@
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
+#include <functional>
 #include "smx_private.h"
 #include "src/mc/mc_forward.hpp"
 #include "xbt/ex.h"
@@ -238,10 +239,10 @@ inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
     return simcall<int, smx_synchro_t>(SIMCALL_COMM_TEST, comm);
   }
   
-inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
+inline static int simcall_BODY_comm_testany(smx_synchro_t* comms, size_t count) {
     /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms);
-    return simcall<int, xbt_dynar_t>(SIMCALL_COMM_TESTANY, comms);
+    if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
+    return simcall<int, smx_synchro_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
   }
   
 inline static smx_mutex_t simcall_BODY_mutex_init() {
@@ -436,8 +437,14 @@ inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char*
     return simcall<void, smx_synchro_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
   }
   
-inline static void simcall_BODY_run_kernel(void* code) {
+inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_run_kernel(code);
-    return simcall<void, void*>(SIMCALL_RUN_KERNEL, code);
+    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
+  }
+  
+inline static void simcall_BODY_run_blocking(std::function<void()> const* code) {
+    /* Go to that function to follow the code flow through the simcall barrier */
+    if (0) SIMIX_run_blocking(code);
+    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);
   }/** @endcond */