From: Oleksandr Stepanov -X (ostepano - SOFTSERVE INC at Cisco) Date: Wed, 23 Jul 2025 19:30:54 +0000 (+0000) Subject: Pull request #4822: appid: change appid_shadow_traffic_status to atomic for thread... X-Git-Tag: 3.9.3.0~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5ca88180c4b75eeed2321806f8261af8856a4f3;p=thirdparty%2Fsnort3.git Pull request #4822: appid: change appid_shadow_traffic_status to atomic for thread safety Merge in SNORT/snort3 from ~OSTEPANO/snort3:shadow_traffic_tsan to master Squashed commit of the following: commit bc119724fa6f56ad57478fde14d31cf8e3e5511c Author: Oleksandr Stepanov Date: Wed Jul 23 05:29:03 2025 -0400 appid: change appid_shadow_traffic_status to atomic for thread safety --- diff --git a/src/network_inspectors/appid/appid_config.h b/src/network_inspectors/appid/appid_config.h index 9468fd12c..0bf4788dc 100644 --- a/src/network_inspectors/appid/appid_config.h +++ b/src/network_inspectors/appid/appid_config.h @@ -22,6 +22,7 @@ #ifndef APP_ID_CONFIG_H #define APP_ID_CONFIG_H +#include #include #include #include @@ -284,12 +285,12 @@ public: void set_appid_shadow_traffic_status(bool status) { - appid_shadow_traffic_status = status; + appid_shadow_traffic_status.store(status, std::memory_order_relaxed); } bool get_appid_shadow_traffic_status() const { - return appid_shadow_traffic_status; + return appid_shadow_traffic_status.load(std::memory_order_relaxed); } unsigned get_pattern_count(); @@ -327,7 +328,7 @@ private: uint32_t version; static uint32_t next_version; - bool appid_shadow_traffic_status = false; + std::atomic appid_shadow_traffic_status = false; }; class OdpThreadContext