Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Template implem of cond_timedwait in sthread
[simgrid.git] / src / kernel / actor / Simcall.cpp
index d34a22d22922f2179cac1ba99cf447cc9d6694e6..05f232f19d2350d0e247be4dae93777283e501a3 100644 (file)
@@ -4,17 +4,14 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/actor/Simcall.hpp"
+#include "simgrid/modelchecker.h"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
 #include "src/kernel/actor/SimcallObserver.hpp"
 #include "src/kernel/context/Context.hpp"
-#include "xbt/log.h"
-
-#if SIMGRID_HAVE_MC
-#include "simgrid/modelchecker.h"
 #include "src/mc/mc_replay.hpp"
-#endif
+#include "xbt/log.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_simcall, kernel, "transmuting from user request into kernel handlers");
 
@@ -48,7 +45,7 @@ void ObjectAccessSimcallItem::take_ownership()
 static void simcall(simgrid::kernel::actor::Simcall::Type call, std::function<void()> const& code,
                     simgrid::kernel::actor::SimcallObserver* observer)
 {
-  auto self                = simgrid::kernel::actor::ActorImpl::self();
+  auto* self               = simgrid::kernel::actor::ActorImpl::self();
   self->simcall_.call_     = call;
   self->simcall_.code_     = &code;
   self->simcall_.observer_ = observer;
@@ -77,16 +74,12 @@ void simcall_run_blocking(std::function<void()> const& code, simgrid::kernel::ac
 
 void simcall_run_object_access(std::function<void()> const& code, simgrid::kernel::actor::ObjectAccessSimcallItem* item)
 {
-  auto self = simgrid::kernel::actor::ActorImpl::self();
+  auto* self = simgrid::kernel::actor::ActorImpl::self();
 
   // We only need a simcall if the order of the setters is important (parallel run or MC execution).
   // Otherwise, just call the function with no simcall
 
-  if (simgrid::kernel::context::Context::is_parallel()
-#if SIMGRID_HAVE_MC
-      || MC_is_active() || MC_record_replay_is_active()
-#endif
-  ) {
+  if (simgrid::kernel::context::Context::is_parallel() || MC_is_active() || MC_record_replay_is_active()) {
     simgrid::kernel::actor::ObjectAccessSimcallObserver observer{self, item};
     simcall(simgrid::kernel::actor::Simcall::Type::RUN_ANSWERED, code, &observer);
     item->take_ownership();