mirror of
https://github.com/esphome/esphome.git
synced 2025-08-07 10:57:46 +00:00
fixes
This commit is contained in:
parent
71f78e3a81
commit
4649599592
@ -226,9 +226,10 @@ void HOT Scheduler::call() {
|
|||||||
// - No deferred items exist in to_add_, so processing order doesn't affect correctness
|
// - No deferred items exist in to_add_, so processing order doesn't affect correctness
|
||||||
while (!this->defer_queue_.empty()) {
|
while (!this->defer_queue_.empty()) {
|
||||||
this->lock_.lock();
|
this->lock_.lock();
|
||||||
if (this->defer_queue_.empty()) // Double-check with lock held
|
if (this->defer_queue_.empty()) { // Double-check with lock held
|
||||||
this->lock_.unlock();
|
this->lock_.unlock();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
auto item = std::move(this->defer_queue_.front());
|
auto item = std::move(this->defer_queue_.front());
|
||||||
this->defer_queue_.pop_front();
|
this->defer_queue_.pop_front();
|
||||||
this->lock_.unlock();
|
this->lock_.unlock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user