X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5c64d08d30a940a53f16f70509a6821b0f94ad8e..1d8c6760b0e7ea8c87d9eb8cd0275f32eac3e6d4:/src/surf/storage_n11.cpp diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index cb5d2459df..d7c60e3c67 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -4,9 +4,10 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "storage_n11.hpp" -#include "maxmin_private.hpp" #include "simgrid/s4u/Engine.hpp" +#include "src/kernel/lmm/maxmin.hpp" #include "src/kernel/routing/NetPoint.hpp" +#include "xbt/utility.hpp" #include /*ceil*/ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage); @@ -143,7 +144,7 @@ int StorageN11Action::unref() refcount_--; if (not refcount_) { if (action_hook.is_linked()) - stateSet_->erase(stateSet_->iterator_to(*this)); + simgrid::xbt::intrusive_erase(*stateSet_, *this); if (getVariable()) getModel()->getMaxminSystem()->variable_free(getVariable()); xbt_free(getCategory()); @@ -161,9 +162,9 @@ void StorageN11Action::cancel() void StorageN11Action::suspend() { XBT_IN("(%p)", this); - if (suspended_ != 2) { + if (suspended_ != Action::SuspendStates::sleeping) { getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0); - suspended_ = 1; + suspended_ = Action::SuspendStates::suspended; } XBT_OUT(); } @@ -175,7 +176,7 @@ void StorageN11Action::resume() bool StorageN11Action::isSuspended() { - return suspended_ == 1; + return suspended_ == Action::SuspendStates::suspended; } void StorageN11Action::setMaxDuration(double /*duration*/)