Browse Source

Fix multithreading transition

Eric Ramat 1 year ago
parent
commit
f6220afb4e
1 changed files with 12 additions and 3 deletions
  1. 12 3
      src/artis-star/kernel/pdevs/multithreading/Coordinator.hpp

+ 12 - 3
src/artis-star/kernel/pdevs/multithreading/Coordinator.hpp

@@ -186,9 +186,8 @@ namespace artis {
                 {
                     assert(t >= type::_tl and t <= type::_tn);
 
-                    common::Models<Time> receivers = type::_event_table.get_current_models(t);
-
-                    type::add_models_with_inputs(receivers);
+                    common::Models<Time> receivers = type::get_receivers();
+                    common::Models<Time> IMM = type::_event_table.get_current_models(t);
 
                     _received = 0;
                     for (auto& model : receivers) {
@@ -198,6 +197,16 @@ namespace artis {
                             ++_received;
                         }
                     }
+                    for (auto& model : IMM) {
+                        if (std::find(receivers.begin(), receivers.end(),
+                                model) == receivers.end()) {
+                            if (model->is_atomic()) {
+                                type::_event_table.put(model->transition(t), model);
+                            } else {
+                                ++_received;
+                            }
+                        }
+                    }
 
                     if (_received > 0) {
                         _received_mutex.lock();