diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 8a26d0e1c2..498e9a11e0 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -597,6 +597,7 @@ void Application::unregister_socket(struct lwip_sock *sock) { #elif defined(USE_SOCKET_SELECT_SUPPORT) bool Application::register_socket_fd(int fd) { // WARNING: This function is NOT thread-safe and must only be called from the main loop + // It modifies socket_fds_ and related variables without locking if (fd < 0) return false; @@ -622,6 +623,7 @@ bool Application::register_socket_fd(int fd) { void Application::unregister_socket_fd(int fd) { // WARNING: This function is NOT thread-safe and must only be called from the main loop + // It modifies socket_fds_ and related variables without locking if (fd < 0) return;