Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
CommWaitTransition mailbox is now valid
[simgrid.git] / src / kernel / context / ContextSwapped.cpp
index dee917bdd477e0d6824721524548d4e3f7d90cfd..9950d44169b3b63ebeeabe484788880a97f67726 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2022. 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. */
@@ -38,7 +38,7 @@
 #include <sanitizer/tsan_interface.h>
 #endif
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context);
 
 // The name of this function is currently hardcoded in MC (as string).
 // Do not change it without fixing those references as well.
@@ -71,7 +71,7 @@ namespace context {
 thread_local SwappedContext* SwappedContext::worker_context_ = nullptr;
 
 SwappedContext::SwappedContext(std::function<void()>&& code, smx_actor_t actor, SwappedContextFactory* factory)
-    : Context(std::move(code), actor), factory_(*factory)
+    : Context(std::move(code), actor, not code /* maestro if no code */), factory_(*factory)
 {
   // Save maestro (=first created context) in preparation for run_all
   if (not is_parallel() && factory_.maestro_context_ == nullptr)
@@ -159,7 +159,7 @@ SwappedContext::~SwappedContext()
       /* try to pursue anyway */
     }
 #if SIMGRID_HAVE_MC
-    /* Retrieve the saved pointer.  See SIMIX_context_stack_new above. */
+    /* Retrieve the saved pointer.  See the initialization above. */
     stack_ = reinterpret_cast<unsigned char**>(stack_)[-1];
 #endif
   }