Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ContextBoost: make maestro_context_ private.
[simgrid.git] / src / kernel / context / ContextBoost.hpp
index a816fe6..b063459 100644 (file)
@@ -32,13 +32,11 @@ class BoostContextFactory;
 /** @brief Userspace context switching implementation based on Boost.Context */
 class BoostContext : public Context {
 protected: // static
-  static bool parallel_;
   static simgrid::xbt::Parmap<smx_actor_t>* parmap_;
   static std::vector<BoostContext*> workers_context_;
   static uintptr_t threads_working_;
   static xbt_os_thread_key_t worker_id_key_;
   static unsigned long process_index_;
-  static BoostContext* maestro_context_;
 
 #if BOOST_VERSION < 105600
   boost::context::fcontext_t* fc_ = nullptr;
@@ -66,7 +64,13 @@ public:
   void stop() override;
   virtual void resume() = 0;
 
+  static BoostContext* getMaestro() { return maestro_context_; }
+  static void setMaestro(BoostContext* maestro) { maestro_context_ = maestro; }
+
   friend BoostContextFactory;
+
+private:
+  static BoostContext* maestro_context_;
 };
 
 class SerialBoostContext : public BoostContext {
@@ -97,6 +101,9 @@ public:
   ~BoostContextFactory() override;
   Context* create_context(std::function<void()> code, void_pfn_smxprocess_t, smx_actor_t process) override;
   void run_all() override;
+
+private:
+  bool parallel_;
 };
 
 }}} // namespace