mirror of
https://github.com/esphome/esphome.git
synced 2025-08-02 16:37:46 +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
|
// Only lock if we're not already in the TCPIP thread
|
||||||
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
|
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
|
||||||
LOCK_TCPIP_CORE();
|
LOCK_TCPIP_CORE();
|
||||||
locked_ = true;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LwIPLock::~LwIPLock() {
|
LwIPLock::~LwIPLock() {
|
||||||
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
|
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
|
||||||
// Only unlock if we locked it
|
// Only unlock if we hold the lock
|
||||||
if (locked_ && sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
|
if (sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
|
||||||
UNLOCK_TCPIP_CORE();
|
UNLOCK_TCPIP_CORE();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -695,11 +695,6 @@ class LwIPLock {
|
|||||||
public:
|
public:
|
||||||
LwIPLock();
|
LwIPLock();
|
||||||
~LwIPLock();
|
~LwIPLock();
|
||||||
|
|
||||||
protected:
|
|
||||||
#if defined(USE_ESP32)
|
|
||||||
bool locked_{false};
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Helper class to request `loop()` to be called as fast as possible.
|
/** Helper class to request `loop()` to be called as fast as possible.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user