mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
fixes
This commit is contained in:
@@ -226,13 +226,14 @@ void HOT Scheduler::call() {
|
||||
// - No deferred items exist in to_add_, so processing order doesn't affect correctness
|
||||
while (!this->defer_queue_.empty()) {
|
||||
this->lock_.lock();
|
||||
if (this->defer_queue_.empty()) { // Double-check with lock held
|
||||
if (this->defer_queue_.empty()) {
|
||||
this->lock_.unlock();
|
||||
break;
|
||||
}
|
||||
auto item = std::move(this->defer_queue_.front());
|
||||
this->defer_queue_.pop_front();
|
||||
this->lock_.unlock();
|
||||
|
||||
// Skip if item was marked for removal or component failed
|
||||
if (!this->should_skip_item_(item.get())) {
|
||||
this->execute_item_(item.get());
|
||||
|
||||
Reference in New Issue
Block a user