mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00:00
[scheduler] Normalise to_remove_empty_/to_remove_count_ preprocessor form
Use `#if defined(X)` / `#elif defined(Y)` / `#else` for the three-way ATOMICS / NO_ATOMICS / SINGLE split. Also fix the SINGLE-branch body indentation to match the other branches.
This commit is contained in:
@@ -626,7 +626,7 @@ class Scheduler {
|
||||
|
||||
// Lock-free check if there are items to remove (for fast-path in cleanup_)
|
||||
bool to_remove_empty_() const {
|
||||
#ifdef ESPHOME_THREAD_MULTI_ATOMICS
|
||||
#if defined(ESPHOME_THREAD_MULTI_ATOMICS)
|
||||
return this->to_remove_.load(std::memory_order_relaxed) == 0;
|
||||
#elif defined(ESPHOME_THREAD_MULTI_NO_ATOMICS)
|
||||
return __atomic_load_n(&this->to_remove_, __ATOMIC_RELAXED) == 0;
|
||||
@@ -660,7 +660,7 @@ class Scheduler {
|
||||
}
|
||||
|
||||
uint32_t to_remove_count_() const {
|
||||
#ifdef ESPHOME_THREAD_MULTI_ATOMICS
|
||||
#if defined(ESPHOME_THREAD_MULTI_ATOMICS)
|
||||
return this->to_remove_.load(std::memory_order_relaxed);
|
||||
#elif defined(ESPHOME_THREAD_MULTI_NO_ATOMICS)
|
||||
return __atomic_load_n(&this->to_remove_, __ATOMIC_RELAXED);
|
||||
|
||||
Reference in New Issue
Block a user