Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Noreturn annotations in contexts.
[simgrid.git] / src / kernel / context / ContextThread.cpp
index 5f1f159..798b050 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2020. 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. */
@@ -22,21 +22,21 @@ namespace context {
 
 // ThreadContextFactory
 
-ThreadContextFactory::ThreadContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
+ThreadContextFactory::ThreadContextFactory() : ContextFactory()
 {
-  if (parallel_)
+  if (SIMIX_context_is_parallel())
     ParallelThreadContext::initialize();
 }
 
 ThreadContextFactory::~ThreadContextFactory()
 {
-  if (parallel_)
+  if (SIMIX_context_is_parallel())
     ParallelThreadContext::finalize();
 }
 
 ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro)
 {
-  if (parallel_)
+  if (SIMIX_context_is_parallel())
     return this->new_context<ParallelThreadContext>(std::move(code), actor, maestro);
   else
     return this->new_context<SerialThreadContext>(std::move(code), actor, maestro);
@@ -44,7 +44,7 @@ ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code
 
 void ThreadContextFactory::run_all()
 {
-  if (parallel_) {
+  if (SIMIX_context_is_parallel()) {
     // Parallel execution
     ParallelThreadContext::run_all();
   } else {