mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 18:37:47 +00:00
Merge branch 'reduce_main_loop' into integration
This commit is contained in:
commit
32729c7ca7
@ -87,7 +87,8 @@ api:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TestComponent test_component;
|
// Use a static instance so it doesn't go out of scope
|
||||||
|
static TestComponent test_component;
|
||||||
test_component.test_defer();
|
test_component.test_defer();
|
||||||
|
|
||||||
ESP_LOGD("defer_test", "Deferred 10 items using defer(), waiting for execution...");
|
ESP_LOGD("defer_test", "Deferred 10 items using defer(), waiting for execution...");
|
||||||
|
@ -32,6 +32,7 @@ void DeferStressComponent::run_multi_thread_test() {
|
|||||||
|
|
||||||
ESP_LOGI(TAG, "Creating %d threads, each will defer %d callbacks", NUM_THREADS, DEFERS_PER_THREAD);
|
ESP_LOGI(TAG, "Creating %d threads, each will defer %d callbacks", NUM_THREADS, DEFERS_PER_THREAD);
|
||||||
|
|
||||||
|
threads.reserve(NUM_THREADS);
|
||||||
for (int i = 0; i < NUM_THREADS; i++) {
|
for (int i = 0; i < NUM_THREADS; i++) {
|
||||||
threads.emplace_back([this, i]() {
|
threads.emplace_back([this, i]() {
|
||||||
ESP_LOGV(TAG, "Thread %d starting", i);
|
ESP_LOGV(TAG, "Thread %d starting", i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user