From cccbc3546cca31b21645f97ce6f2ec3ad858f920 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Wed, 22 May 2024 19:12:18 +0800 Subject: [PATCH] ESP32: Lock Thread stack before calling GenericOpenThread::DoInit() --- src/platform/ESP32/ThreadStackManagerImpl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/ESP32/ThreadStackManagerImpl.cpp b/src/platform/ESP32/ThreadStackManagerImpl.cpp index 0449607999668b..c05a911a8b4adb 100644 --- a/src/platform/ESP32/ThreadStackManagerImpl.cpp +++ b/src/platform/ESP32/ThreadStackManagerImpl.cpp @@ -52,8 +52,12 @@ ThreadStackManagerImpl ThreadStackManagerImpl::sInstance; CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack() { + CHIP_ERROR err = CHIP_NO_ERROR; openthread_init_stack(); - return GenericThreadStackManagerImpl_OpenThread::DoInit(esp_openthread_get_instance()); + _LockThreadStack(); + err = GenericThreadStackManagerImpl_OpenThread::DoInit(esp_openthread_get_instance()); + _UnlockThreadStack(); + return err; } CHIP_ERROR ThreadStackManagerImpl::_StartThreadTask()