mirror of
https://github.com/esphome/esphome.git
synced 2025-10-24 04:33:49 +01:00
Reduce web_server loop overhead on ESP32 by avoiding unnecessary semaphore operations (#9308)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/semphr.h>
|
||||
#include <deque>
|
||||
#include <atomic>
|
||||
#endif
|
||||
|
||||
#if USE_WEBSERVER_VERSION >= 2
|
||||
@@ -524,6 +525,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
|
||||
#ifdef USE_ESP32
|
||||
std::deque<std::function<void()>> to_schedule_;
|
||||
SemaphoreHandle_t to_schedule_lock_;
|
||||
std::atomic<bool> to_schedule_has_items_{false};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user