mirror of
https://github.com/esphome/esphome.git
synced 2025-08-02 08:27:47 +00:00
simplify
This commit is contained in:
parent
94fd2d8ca1
commit
f1d2300153
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user