X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/01b6b0c026e5fa6a87a45b53a4ce1e4dc580a358..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/src/kernel/activity/ActivityImpl.cpp diff --git a/src/kernel/activity/ActivityImpl.cpp b/src/kernel/activity/ActivityImpl.cpp index be0e1b0d30..baa4dc03f2 100644 --- a/src/kernel/activity/ActivityImpl.cpp +++ b/src/kernel/activity/ActivityImpl.cpp @@ -1,9 +1,10 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2020. 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. */ #include "src/kernel/activity/ActivityImpl.hpp" +#include "src/simix/smx_private.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process); @@ -12,10 +13,21 @@ namespace kernel { namespace activity { ActivityImpl::~ActivityImpl() +{ + clean_action(); + 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_) { surf_action_->unref(); - XBT_DEBUG("Destroy activity %p", this); surf_action_ = nullptr; } } @@ -48,6 +60,7 @@ void ActivityImpl::cancel() XBT_VERB("Activity %p is canceled", this); if (surf_action_ != nullptr) surf_action_->cancel(); + state_ = State::CANCELED; } // boost::intrusive_ptr support: