mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-08-14 14:50:01 +00:00
fix(tcp): drop redundant _online write in the task to remove a race (greptile)
task_loop() set `_online = true` during the CONNECTING window, which races with loop()'s `_online = false` on the main loop (plain bool, no synchronizes-with). It's redundant: the main loop sets `_online = true` when it observes CONNECTED. Removing it eliminates the race with no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
4a9e44318c
commit
7be3138fc5
@@ -290,7 +290,9 @@ void TCPClientInterface::task_loop() {
|
||||
if (connect()) {
|
||||
_frame_buffer.clear();
|
||||
_last_data_received = millis();
|
||||
_online = true;
|
||||
// _online is owned by the main loop (it sets it on
|
||||
// observing CONNECTED); writing it here would race with
|
||||
// loop()'s `_online = false` during the CONNECTING window.
|
||||
_reconnected.store(true); // main loop announces
|
||||
_conn_state.store(CONNECTED); // hand _client to main loop
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user