Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add capacity to set priorities on I/Os + example
[simgrid.git] / src / kernel / context / ContextThread.cpp
index 4399d82..2b8c1d1 100644 (file)
@@ -8,7 +8,6 @@
 #include "simgrid/Exception.hpp"
 #include "src/internal_config.h" /* loads context system definitions */
 #include "src/kernel/EngineImpl.hpp"
-#include "src/simix/smx_private.hpp"
 #include "xbt/function_types.h"
 #include "xbt/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */
 
@@ -27,21 +26,21 @@ namespace context {
 
 ThreadContextFactory::ThreadContextFactory() : ContextFactory()
 {
-  if (smx_context_stack_size != 8 * 1024 * 1024)
+  if (stack_size != 8 * 1024 * 1024)
     XBT_INFO("Stack size modifications are ignored by thread factory.");
-  if (SIMIX_context_is_parallel())
+  if (is_parallel())
     ParallelThreadContext::initialize();
 }
 
 ThreadContextFactory::~ThreadContextFactory()
 {
-  if (SIMIX_context_is_parallel())
+  if (is_parallel())
     ParallelThreadContext::finalize();
 }
 
 ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro)
 {
-  if (SIMIX_context_is_parallel())
+  if (is_parallel())
     return this->new_context<ParallelThreadContext>(std::move(code), actor, maestro);
   else
     return this->new_context<SerialThreadContext>(std::move(code), actor, maestro);
@@ -49,7 +48,7 @@ ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code
 
 void ThreadContextFactory::run_all()
 {
-  if (SIMIX_context_is_parallel()) {
+  if (is_parallel()) {
     // Parallel execution
     ParallelThreadContext::run_all();
   } else {
@@ -193,7 +192,7 @@ xbt::OsSemaphore* ParallelThreadContext::thread_sem_ = nullptr;
 
 void ParallelThreadContext::initialize()
 {
-  thread_sem_ = new xbt::OsSemaphore(SIMIX_context_get_nthreads());
+  thread_sem_ = new xbt::OsSemaphore(get_nthreads());
 }
 
 void ParallelThreadContext::finalize()