Skip to content

Commit

Permalink
Fix another bug in previous commits.
Browse files Browse the repository at this point in the history
Something weird happened during startup where perhaps the event queue
was not yet initialized in a way that satisfies the usual invariant that
it contains no events in the past. I did not take the time to
investigate this in sufficient depth to say more.
  • Loading branch information
petervdonovan committed Sep 1, 2023
1 parent 49483cf commit 4ae2a20
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/federated/federate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2742,12 +2742,11 @@ tag_t _lf_send_next_event_tag(environment_t* env, tag_t tag, bool wait_for_reply
lf_print_error("Wait error.");
}
// Check whether the new event on the event queue requires sending a new NET.
tag_t next_tag = get_next_event_tag(env);
if (
lf_tag_compare(_fed.last_TAG, next_tag) >= 0
|| lf_tag_compare(_fed.last_TAG, tag) >= 0
) {
return _fed.last_TAG;
if (lf_tag_compare(_fed.last_TAG, tag) >= 0) {
tag_t next_tag = get_next_event_tag(env);
if (lf_tag_compare(_fed.last_TAG, next_tag) >= 0) {
return _fed.last_TAG;
}
}
if (lf_tag_compare(next_tag, tag) != 0) {
_lf_send_tag(MSG_TYPE_NEXT_EVENT_TAG, next_tag, wait_for_reply);
Expand Down

0 comments on commit 4ae2a20

Please sign in to comment.