From ddbd606860016c63f11358ce49cd6c61ab4d1563 Mon Sep 17 00:00:00 2001 From: Mariappan Ramasamy <142216110+kp-mariappan-ramasamy@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:27:29 +0800 Subject: [PATCH] Fix atomic access of first message received --- src/he/flow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/he/flow.c b/src/he/flow.c index 3a2ba95..694ebd5 100644 --- a/src/he/flow.c +++ b/src/he/flow.c @@ -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); }