Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
unify how threaded and parallelisable context factories find context_self
[simgrid.git] / src / kernel / context / ContextRaw.hpp
index 6996280..e1ececd 100644 (file)
@@ -31,8 +31,8 @@ public:
   virtual void resume() = 0;
 
   static void swap(RawContext* from, RawContext* to);
-  static RawContext* getMaestro() { return maestro_context_; }
-  static void setMaestro(RawContext* maestro) { maestro_context_ = maestro; }
+  static RawContext* get_maestro() { return maestro_context_; }
+  static void set_maestro(RawContext* maestro) { maestro_context_ = maestro; }
 
 private:
   static RawContext* maestro_context_;
@@ -40,7 +40,7 @@ private:
   /** pointer to top the stack stack */
   void* stack_top_ = nullptr;
 
-#if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
+#if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT
   const void* asan_stack_ = nullptr;
   size_t asan_stack_size_ = 0;
   RawContext* asan_ctx_   = nullptr;
@@ -65,7 +65,6 @@ private:
   static unsigned long process_index_;
 };
 
-#if HAVE_THREAD_CONTEXTS
 class ParallelRawContext : public RawContext {
 public:
   ParallelRawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
@@ -83,9 +82,8 @@ private:
   static simgrid::xbt::Parmap<smx_actor_t>* parmap_;
   static std::vector<ParallelRawContext*> workers_context_;
   static std::atomic<uintptr_t> threads_working_;
-  static xbt_os_thread_key_t worker_id_key_;
+  static uintptr_t thread_local worker_id_;
 };
-#endif
 
 class RawContextFactory : public ContextFactory {
 public: