Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use RAII for sthread_enable/disable.
[simgrid.git] / src / kernel / context / ContextBoost.cpp
index f7d76cbc3186d4bf24fe3792ab0eaf35c2b3ae99..8f3a9e4b34045c2cc9041a938dfa6a5def18ae43 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2023. 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. */
@@ -6,13 +6,10 @@
 #include "ContextBoost.hpp"
 #include "simgrid/Exception.hpp"
 #include "src/internal_config.h"
-#include "src/simix/smx_private.hpp"
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context);
 
-namespace simgrid {
-namespace kernel {
-namespace context {
+namespace simgrid::kernel::context {
 
 // BoostContextFactory
 BoostContext* BoostContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor)
@@ -51,7 +48,7 @@ void BoostContext::wrapper(BoostContext::arg_type arg)
 
 void BoostContext::swap_into_for_real(SwappedContext* to_)
 {
-  BoostContext* to = static_cast<BoostContext*>(to_);
+  auto* to = static_cast<BoostContext*>(to_);
 #if BOOST_VERSION < 106100
   boost::context::jump_fcontext(&this->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
 #else
@@ -67,6 +64,4 @@ XBT_PRIVATE ContextFactory* boost_factory()
   XBT_VERB("Using Boost contexts. Welcome to the 21th century.");
   return new BoostContextFactory();
 }
-} // namespace context
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::context