logger: fix TSAN issue

This commit is contained in:
Julian Oes 2026-02-18 13:27:20 +13:00
parent 2c833f5ae2
commit 17ac592cd2
No known key found for this signature in database
GPG Key ID: F0ED380FEA56DE41
2 changed files with 3 additions and 3 deletions

View File

@ -1134,7 +1134,7 @@ bool Logger::start_stop_logging()
}
}
desired_state = desired_state || _manually_logging_override;
desired_state = desired_state || _manually_logging_override.load();
// only start/stop if this is a state transition
if (updated && _prev_file_log_start_state != desired_state) {

View File

@ -144,7 +144,7 @@ public:
void print_statistics(LogType type);
void set_arm_override(bool override) { _manually_logging_override = override; }
void set_arm_override(bool override) { _manually_logging_override.store(override); }
void trigger_watchdog_now()
{
@ -345,7 +345,7 @@ private:
LogFileName _file_name[(int)LogType::Count];
bool _prev_file_log_start_state{false}; ///< previous state depending on logging mode (arming or aux1 state)
bool _manually_logging_override{false};
px4::atomic_bool _manually_logging_override{false};
Statistics _statistics[(int)LogType::Count];
hrt_abstime _last_sync_time{0}; ///< last time a sync msg was sent