From f1d2300153c0aa26484874f54909c9d1b2b966e2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 16 Jul 2025 13:10:00 -1000 Subject: [PATCH] simplify --- esphome/components/esp32/helpers.cpp | 5 ++--- esphome/core/helpers.h | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/esphome/components/esp32/helpers.cpp b/esphome/components/esp32/helpers.cpp index cfc648e1d1..13b12157c4 100644 --- a/esphome/components/esp32/helpers.cpp +++ b/esphome/components/esp32/helpers.cpp @@ -39,15 +39,14 @@ LwIPLock::LwIPLock() { // Only lock if we're not already in the TCPIP thread if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) { LOCK_TCPIP_CORE(); - locked_ = true; } #endif } LwIPLock::~LwIPLock() { #ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING - // Only unlock if we locked it - if (locked_ && sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) { + // Only unlock if we hold the lock + if (sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) { UNLOCK_TCPIP_CORE(); } #endif diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 745b3e5e8e..6650a1c4d5 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -695,11 +695,6 @@ class LwIPLock { public: LwIPLock(); ~LwIPLock(); - - protected: -#if defined(USE_ESP32) - bool locked_{false}; -#endif }; /** Helper class to request `loop()` to be called as fast as possible.