X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d5cbd0a045f9b4c686d265723f542dd92f47593b..0c956d214e807eec6b3d6d43ebf52d7752f11b1f:/src/kernel/context/ContextThread.hpp diff --git a/src/kernel/context/ContextThread.hpp b/src/kernel/context/ContextThread.hpp index 3449f88a59..62d8191257 100644 --- a/src/kernel/context/ContextThread.hpp +++ b/src/kernel/context/ContextThread.hpp @@ -22,9 +22,7 @@ class ThreadContextFactory; class ThreadContext : public AttachContext { public: friend ThreadContextFactory; - ThreadContext(std::function code, - void_pfn_smxprocess_t cleanup_func, - smx_actor_t process, bool maestro =false); + ThreadContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro); ~ThreadContext() override; void stop() override; void suspend() override; @@ -37,11 +35,13 @@ private: xbt_os_sem_t begin_ = nullptr; /** Semaphore used to schedule/unschedule */ xbt_os_sem_t end_ = nullptr; + bool is_maestro_; static void* wrapper(void *param); static void* maestro_wrapper(void *param); public: void start(); + void yield(); }; class ThreadContextFactory : public ContextFactory {