* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/activity/ActivityImpl.hpp"
+#include "src/simix/smx_private.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
XBT_DEBUG("Destroy activity %p", this);
}
+void ActivityImpl::register_simcall(smx_simcall_t simcall)
+{
+ simcalls_.push_back(simcall);
+ simcall->issuer->waiting_synchro = this;
+}
+
void ActivityImpl::clean_action()
{
if (surf_action_) {
virtual void post() = 0; // What to do when a simcall terminates
virtual void finish() = 0;
+ virtual void register_simcall(smx_simcall_t simcall);
virtual void clean_action();
virtual double get_remaining() const;
// boost::intrusive_ptr<ActivityImpl> support:
/* Associate this simcall to the wait synchro */
XBT_DEBUG("simcall_HANDLER_comm_wait, %p", comm);
- comm->simcalls_.push_back(simcall);
- simcall->issuer->waiting_synchro = comm;
+ comm->register_simcall(simcall);
if (MC_is_active() || MC_record_replay_is_active()) {
int idx = SIMCALL_GET_MC_VALUE(simcall);
XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
/* Associate this simcall to the synchro */
- synchro->simcalls_.push_back(simcall);
- simcall->issuer->waiting_synchro = synchro;
+ synchro->register_simcall(simcall);
/* set surf's synchro */
if (MC_is_active() || MC_record_replay_is_active()) {
XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
/* Associate this simcall to the synchro */
- synchro->simcalls_.push_back(simcall);
- simcall->issuer->waiting_synchro = synchro;
+ synchro->register_simcall(simcall);
/* set surf's synchro */
if (MC_is_active() || MC_record_replay_is_active()) {