Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make EngineImpl::tasksTemp a local variable.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Jul 2021 20:55:03 +0000 (22:55 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Jul 2021 21:40:56 +0000 (23:40 +0200)
src/kernel/EngineImpl.cpp
src/kernel/EngineImpl.hpp

index fecdfb9..d065c9f 100644 (file)
@@ -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<xbt::Task<void()>> tasksTemp;
   do {
     // We don't want the callbacks to modify the vector we are iterating over:
     tasks.swap(tasksTemp);
index 5f5aa83..b448c06 100644 (file)
@@ -68,7 +68,6 @@ class EngineImpl {
 #endif
 
   std::vector<xbt::Task<void()>> tasks;
-  std::vector<xbt::Task<void()>> tasksTemp;
 
   std::mutex mutex_;
   std::unique_ptr<void, std::function<int(void*)>> platf_handle_; //!< handle for platform library