Skip to content

Commit

Permalink
Fix atomic access of first message received
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-mariappan-ramasamy committed Jan 6, 2025
1 parent eb3855b commit ddbd606
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/he/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,13 @@ he_return_code_t he_internal_flow_outside_data_verify_connection(he_conn_t *conn
}

// Check to see if this is our first message and trigger an event change if it is
#ifdef HE_ENABLE_MULTITHREADED
bool expected = false;
if (atomic_compare_exchange_strong(&conn->first_message_received, &expected, true)) {
#else
if (!conn->first_message_received) {
conn->first_message_received = true;
#endif
he_internal_generate_event(conn, HE_EVENT_FIRST_MESSAGE_RECEIVED);
}

Expand Down

0 comments on commit ddbd606

Please sign in to comment.