A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'plugins-energy-battery-interaction' into 'master'
[simgrid.git]
/
src
/
kernel
/
activity
/
SleepImpl.cpp
diff --git
a/src/kernel/activity/SleepImpl.cpp
b/src/kernel/activity/SleepImpl.cpp
index
2434802
..
6a529e8
100644
(file)
--- a/
src/kernel/activity/SleepImpl.cpp
+++ b/
src/kernel/activity/SleepImpl.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-202
1
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-202
3
. 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. */
/* 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. */
@@
-8,12
+8,10
@@
#include "src/kernel/activity/SleepImpl.hpp"
#include "src/kernel/actor/ActorImpl.hpp"
#include "src/kernel/resource/CpuImpl.hpp"
#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(simix_process);
-namespace simgrid {
-namespace kernel {
-namespace activity {
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_actor);
+
+namespace simgrid::kernel::activity {
SleepImpl& SleepImpl::set_host(s4u::Host* host)
{
SleepImpl& SleepImpl::set_host(s4u::Host* host)
{
@@
-29,33
+27,31
@@
SleepImpl& SleepImpl::set_duration(double duration)
SleepImpl* SleepImpl::start()
{
SleepImpl* SleepImpl::start()
{
-
surf
_action_ = host_->get_cpu()->sleep(duration_);
-
surf
_action_->set_activity(this);
+
model
_action_ = host_->get_cpu()->sleep(duration_);
+
model
_action_->set_activity(this);
XBT_DEBUG("Create sleep synchronization %p", this);
return this;
}
XBT_DEBUG("Create sleep synchronization %p", this);
return this;
}
-void SleepImpl::post()
+void SleepImpl::set_exception(actor::ActorImpl* issuer)
+{
+ /* FIXME: Really, nothing bad can happen while we sleep? */
+}
+void SleepImpl::finish()
{
{
- if (
surf
_action_->get_state() == resource::Action::State::FAILED) {
+ if (
model
_action_->get_state() == resource::Action::State::FAILED) {
if (host_ && not host_->is_on())
if (host_ && not host_->is_on())
- s
tate_ = State::SRC_HOST_FAILURE
;
+ s
et_state(State::SRC_HOST_FAILURE)
;
else
else
- s
tate_ = State::CANCELED
;
- } else if (
surf
_action_->get_state() == resource::Action::State::FINISHED) {
- s
tate_ = State::DONE
;
+ s
et_state(State::CANCELED)
;
+ } else if (
model
_action_->get_state() == resource::Action::State::FINISHED) {
+ s
et_state(State::DONE)
;
}
clean_action();
}
clean_action();
- /* Answer all simcalls associated with the synchro */
- finish();
-}
-
-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()) {
while (not simcalls_.empty()) {
- const
s_smx_s
imcall* simcall = simcalls_.front();
+ const
actor::S
imcall* simcall = simcalls_.front();
simcalls_.pop_front();
simcall->issuer_->waiting_synchro_ = nullptr;
simcalls_.pop_front();
simcall->issuer_->waiting_synchro_ = nullptr;
@@
-68,6
+64,4
@@
void SleepImpl::finish()
}
}
}
}
}
}
-} // namespace activity
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::activity