Skip to content

Commit

Permalink
bugfix: allow ports to have both triggers and further bindings
Browse files Browse the repository at this point in the history
In case of nested reactors, the outer reactor might have a reaction
triggered by the port, but also a connection to an input of the nested
reactor.
  • Loading branch information
cmnrd committed Jul 8, 2022
1 parent 02c970c commit 33fb712
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,12 @@ void Scheduler::set_port(BasePort* port) {
set_port_helper(port);
}

void Scheduler::set_port_helper(BasePort* port) { // NOLINT
reactor_assert(!(port->has_outward_bindings() && !port->triggers().empty()));
if (port->has_outward_bindings()) {
for (auto* binding : port->outward_bindings()) {
set_port_helper(binding);
}
} else {
for (auto* reaction : port->triggers()) {
triggered_reactions_[Worker::current_worker_id()].push_back(reaction);
}
void Scheduler::set_port_helper(BasePort* port) {
for (auto* reaction : port->triggers()) {
triggered_reactions_[Worker::current_worker_id()].push_back(reaction);
}
for (auto* binding : port->outward_bindings()) {
set_port_helper(binding);
}
}

Expand Down

0 comments on commit 33fb712

Please sign in to comment.