-/* 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. */
#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.
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)
/* 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
}