From: Arnaud Giersch Date: Tue, 6 Jul 2021 20:55:03 +0000 (+0200) Subject: Make EngineImpl::tasksTemp a local variable. X-Git-Tag: v3.28~31 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c622217f3ef6d36aa61c4f667defb884160ec581 Make EngineImpl::tasksTemp a local variable. --- diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index fecdfb99eb..d065c9fa2f 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -178,11 +178,10 @@ actor::ActorImpl* EngineImpl::get_actor_by_pid(aid_t pid) /** Execute all the tasks that are queued, e.g. `.then()` callbacks of futures. */ bool EngineImpl::execute_tasks() { - xbt_assert(tasksTemp.empty()); - if (tasks.empty()) return false; + std::vector> tasksTemp; do { // We don't want the callbacks to modify the vector we are iterating over: tasks.swap(tasksTemp); diff --git a/src/kernel/EngineImpl.hpp b/src/kernel/EngineImpl.hpp index 5f5aa83f20..b448c0693b 100644 --- a/src/kernel/EngineImpl.hpp +++ b/src/kernel/EngineImpl.hpp @@ -68,7 +68,6 @@ class EngineImpl { #endif std::vector> tasks; - std::vector> tasksTemp; std::mutex mutex_; std::unique_ptr> platf_handle_; //!< handle for platform library