X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dbd7e7a54fc9a2f7121d065b9ef44f990643f4eb..3a403e463ecccd4a15bbf4aeb05c860fdd7c5db1:/src/kernel/resource/Resource.hpp diff --git a/src/kernel/resource/Resource.hpp b/src/kernel/resource/Resource.hpp index bf67c6a42f..6c864e33b9 100644 --- a/src/kernel/resource/Resource.hpp +++ b/src/kernel/resource/Resource.hpp @@ -101,6 +101,17 @@ public: lmm::Constraint* get_constraint() const { return constraint_; } + /** @brief Set the concurrency limit for this resource */ + virtual void set_concurrency_limit(int limit) const + { + if (limit != -1) + get_constraint()->reset_concurrency_maximum(); + get_constraint()->set_concurrency_limit(limit); + } + + /** @brief Get the concurrency limit of this resource */ + virtual int get_concurrency_limit() const { return get_constraint()->get_concurrency_limit(); } + /** @brief returns the current load due to activities (in flops per second, byte per second or similar) * * The load due to external usages modeled by profile files is ignored.*/