mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
Needed for ESPEasy-NOW PR, but may be useful in other data structures too. On ESP32, the callback functions from network/WiFi can come from another core (and on single core, from another task), so data structures shared among RTOS tasks or callback events may need these for sure. Not sure if these are currently needed on ESP8266, as all is dealt with on the same core and we also do not access tricky data structures in callback functions (yet) But for ESPEasy-NOW we will use std::map data structures which sometimes need to rebalance their RB-tree from callback functions. Those will for sure cause crashes when interrupted during erase or insert as both may cause RB-tree balancing. Note: Not sure what will happen on ESP8266 if a callback function ends up in a lock() call. On ESP32 this will not really cause issues as tasks are time slotted, but ESP8266 does not have these.