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
_SIMIX_cond_wait becomes ConditionVariable::wait
[simgrid.git]
/
src
/
kernel
/
activity
/
SynchroRaw.cpp
diff --git
a/src/kernel/activity/SynchroRaw.cpp
b/src/kernel/activity/SynchroRaw.cpp
index
3287a00
..
5b3efd5
100644
(file)
--- a/
src/kernel/activity/SynchroRaw.cpp
+++ b/
src/kernel/activity/SynchroRaw.cpp
@@
-5,33
+5,58
@@
#include "src/kernel/activity/SynchroRaw.hpp"
#include "simgrid/kernel/resource/Action.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
#include "simgrid/kernel/resource/Action.hpp"
+#include "src/kernel/context/Context.hpp"
#include "src/simix/smx_synchro_private.hpp"
#include "src/simix/smx_synchro_private.hpp"
+#include "src/surf/cpu_interface.hpp"
#include "src/surf/surf_interface.hpp"
#include "src/surf/surf_interface.hpp"
+#include <simgrid/s4u/Host.hpp>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
-simgrid::kernel::activity::RawImpl::~RawImpl()
+namespace simgrid {
+namespace kernel {
+namespace activity {
+
+RawImpl* RawImpl::start(s4u::Host* host, double timeout)
+{
+ surf_action_ = host->pimpl_cpu->sleep(timeout);
+ surf_action_->set_data(this);
+ return this;
+}
+
+RawImpl::~RawImpl()
{
surf_action_->unref();
}
{
surf_action_->unref();
}
-void simgrid::kernel::activity::RawImpl::suspend()
+
+void RawImpl::suspend()
{
/* The suspension of raw synchros is delayed to when the process is rescheduled. */
}
{
/* The suspension of raw synchros is delayed to when the process is rescheduled. */
}
-void
simgrid::kernel::activity::
RawImpl::resume()
+void RawImpl::resume()
{
/* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
* the end of the synchro. */
}
{
/* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
* the end of the synchro. */
}
-void
simgrid::kernel::activity::
RawImpl::post()
+void RawImpl::post()
{
XBT_IN("(%p)",this);
{
XBT_IN("(%p)",this);
- if (surf_action_->get_state() == simgrid::kernel::resource::Action::State::FAILED)
+ smx_simcall_t simcall = simcalls_.front();
+ simcalls_.pop_front();
+
+ SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
+ simcall->issuer->waiting_synchro = nullptr;
+
+ if (surf_action_->get_state() == resource::Action::State::FAILED) {
state_ = SIMIX_FAILED;
state_ = SIMIX_FAILED;
- else if (surf_action_->get_state() == simgrid::kernel::resource::Action::State::FINISHED)
+ simcall->issuer->context_->iwannadie = true;
+ } else if (surf_action_->get_state() == resource::Action::State::FINISHED) {
state_ = SIMIX_SRC_TIMEOUT;
state_ = SIMIX_SRC_TIMEOUT;
-
- SIMIX_synchro_finish(this);
+ SIMIX_simcall_answer(simcall);
+ }
XBT_OUT();
}
XBT_OUT();
}
+} // namespace activity
+} // namespace kernel
+} // namespace simgrid