Parcourir la source

pdevs/multithreading: optimize transition send

Eric Ramat il y a 3 ans
Parent
commit
db4b4b025d
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      src/artis-star/kernel/pdevs/multithreading/Coordinator.hpp

+ 6 - 2
src/artis-star/kernel/pdevs/multithreading/Coordinator.hpp

@@ -228,8 +228,12 @@ public:
     if (_received > 0) {
       std::unique_lock <std::mutex> lock(_received_mutex);
 
-      type::_graph_manager.transition(receivers, t);
-      type::_graph_manager.transition(IMM, t);
+      if (not receivers.empty()) {
+        type::_graph_manager.transition(receivers, t);
+      }
+      if (not IMM.empty()) {
+        type::_graph_manager.transition(IMM, t);
+      }
       _condition.wait(lock);
     }