1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00
This commit is contained in:
J. Nick Koston
2025-07-06 20:26:43 -05:00
parent fb3c092eaa
commit a0d2392344
3 changed files with 134 additions and 1 deletions

View File

@@ -386,7 +386,7 @@ void HOT Scheduler::process_to_add() {
void HOT Scheduler::cleanup_() {
// Fast path: if nothing to remove, just return
// Reading to_remove_ without lock is safe because:
// 1. It's volatile, ensuring we read the latest value
// 1. We only call this from the main thread during call()
// 2. If it's 0, there's definitely nothing to cleanup
// 3. If it becomes non-zero after we check, cleanup will happen next time
if (this->to_remove_ == 0)