Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a std::unique_ptr, and avoid explicit new/delete.
[simgrid.git] / src / kernel / activity / SleepImpl.cpp
index 68382f1c532fe40861661dfa9abb868c68b91874..78813f718b078a9bd746cc7730c47909b2358d82 100644 (file)
@@ -8,7 +8,6 @@
 #include "src/kernel/activity/SleepImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
 #include "src/kernel/resource/CpuImpl.hpp"
-#include "src/simix/popping_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_actor);
 
@@ -40,11 +39,11 @@ void SleepImpl::post()
 {
   if (surf_action_->get_state() == resource::Action::State::FAILED) {
     if (host_ && not host_->is_on())
-      state_ = State::SRC_HOST_FAILURE;
+      set_state(State::SRC_HOST_FAILURE);
     else
-      state_ = State::CANCELED;
+      set_state(State::CANCELED);
   } else if (surf_action_->get_state() == resource::Action::State::FINISHED) {
-    state_ = State::DONE;
+    set_state(State::DONE);
   }
 
   clean_action();
@@ -57,9 +56,9 @@ void SleepImpl::set_exception(actor::ActorImpl* issuer)
 }
 void SleepImpl::finish()
 {
-  XBT_DEBUG("SleepImpl::finish() in state %s", to_c_str(state_));
+  XBT_DEBUG("SleepImpl::finish() in state %s", get_state_str());
   while (not simcalls_.empty()) {
-    const s_smx_simcall* simcall = simcalls_.front();
+    const actor::Simcall* simcall = simcalls_.front();
     simcalls_.pop_front();
 
     simcall->issuer_->waiting_synchro_ = nullptr;