X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a8a66c743439c94d5de5bcb8a3e50dcd207b6d2f..8d0b1f2f1840a16bb9551f1cfd74f2488599f95b:/src/kernel/actor/SynchroObserver.hpp diff --git a/src/kernel/actor/SynchroObserver.hpp b/src/kernel/actor/SynchroObserver.hpp index 90c7335883..7c5ddc0c9d 100644 --- a/src/kernel/actor/SynchroObserver.hpp +++ b/src/kernel/actor/SynchroObserver.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2019-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2019-2023. 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. */ @@ -7,6 +7,7 @@ #define SIMGRID_MC_MUTEX_OBSERVER_HPP #include "simgrid/forward.h" +#include "src/kernel/activity/ConditionVariableImpl.hpp" #include "src/kernel/activity/MutexImpl.hpp" #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/SimcallObserver.hpp" @@ -80,6 +81,26 @@ public: double get_timeout() const { return timeout_; } }; +class ConditionWaitSimcall final : public ResultingSimcall { + mc::Transition::Type type_; + activity::ConditionVariableImpl* const cond_; + activity::MutexImpl* const mutex_; + const double timeout_; + +public: + ConditionWaitSimcall(ActorImpl* actor, activity::ConditionVariableImpl* cond, activity::MutexImpl* mutex, + double timeout = -1.0) + : ResultingSimcall(actor, false), cond_(cond), mutex_(mutex), timeout_(timeout) + { + } + void serialize(std::stringstream& stream) const override; + std::string to_string() const override; + bool is_enabled() override; + activity::ConditionVariableImpl* get_cond() const { return cond_; } + activity::MutexImpl* get_mutex() const { return mutex_; } + double get_timeout() const { return timeout_; } +}; + } // namespace simgrid::kernel::actor #endif