Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
properly split init/start for Exec activities
[simgrid.git] / src / simix / smx_private.hpp
index e220311..f22840c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,7 +8,10 @@
 
 #include "simgrid/s4u/Actor.hpp"
 #include "src/kernel/context/Context.hpp"
+#include "src/simix/ActorImpl.hpp"
 
+#include <boost/intrusive/list.hpp>
+#include <mutex>
 #include <unordered_map>
 #include <vector>
 
@@ -18,7 +21,7 @@ namespace simgrid {
 namespace simix {
 
 class Global {
-  friend XBT_PUBLIC bool simgrid::s4u::this_actor::isMaestro();
+  friend XBT_PUBLIC bool simgrid::s4u::this_actor::is_maestro();
 
 public:
   smx_context_factory_t context_factory = nullptr;
@@ -49,11 +52,7 @@ public:
   // This might be used when no corresponding function name is registered:
   simgrid::simix::ActorCodeFactory default_function;
 
-  smx_creation_func_t create_process_function = nullptr;
-  void_pfn_smxprocess_t kill_process_function = nullptr;
-  /** Callback used when killing a SMX_process */
-  void_pfn_smxprocess_t cleanup_process_function = nullptr;
-  xbt_os_mutex_t mutex                           = nullptr;
+  std::mutex mutex;
 
   std::vector<simgrid::xbt::Task<void()>> tasks;
   std::vector<simgrid::xbt::Task<void()>> tasksTemp;
@@ -63,8 +62,6 @@ public:
 }
 }
 
-extern "C" {
-
 XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
 
 XBT_PUBLIC void SIMIX_clean();
@@ -80,6 +77,5 @@ XBT_PUBLIC void SIMIX_clean();
     _smx_throw_issuer->exception = std::make_exception_ptr(e);                                                         \
   } else                                                                                                               \
     ((void)0)
-}
 
 #endif