浏览代码

pdevs/multithreading: optimize transition send

Eric Ramat 3 年之前
父节点
当前提交
db4b4b025d
共有 1 个文件被更改,包括 6 次插入2 次删除
  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);
     }