X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c98615d9dab06a7d902e1c62ddab30d2e90d6f17..3f9b311ec56db95ec539001a860ae3c838c48312:/src/mc/transition/TransitionObjectAccess.cpp diff --git a/src/mc/transition/TransitionObjectAccess.cpp b/src/mc/transition/TransitionObjectAccess.cpp index d16472e98a..f32e459008 100644 --- a/src/mc/transition/TransitionObjectAccess.cpp +++ b/src/mc/transition/TransitionObjectAccess.cpp @@ -15,14 +15,14 @@ ObjectAccessTransition::ObjectAccessTransition(aid_t issuer, int times_considere { short s; xbt_assert(stream >> s >> objaddr_ >> objname_ >> file_ >> line_); - type_ = static_cast(s); + access_type_ = static_cast(s); } std::string ObjectAccessTransition::to_string(bool verbose) const { std::string res; - if (type_ == ObjectAccessType::ENTER) + if (access_type_ == ObjectAccessType::ENTER) res = std::string("BeginObjectAccess("); - else if (type_ == ObjectAccessType::EXIT) + else if (access_type_ == ObjectAccessType::EXIT) res = std::string("EndObjectAccess("); else res = std::string("ObjectAccess("); @@ -34,9 +34,23 @@ std::string ObjectAccessTransition::to_string(bool verbose) const } bool ObjectAccessTransition::depends(const Transition* o) const { + if (o->type_ < type_) + return o->depends(this); + + // Actions executed by the same actor are always dependent + if (o->aid_ == aid_) + return true; + if (const auto* other = dynamic_cast(o)) return objaddr_ == other->objaddr_; // dependent only if it's an access to the same object return false; } +bool ObjectAccessTransition::reversible_race(const Transition* other) const +{ + xbt_assert(type_ == Type::OBJECT_ACCESS, "Unexpected transition type %s", to_c_str(type_)); + + return true; // Object access is always enabled +} + } // namespace simgrid::mc