Skip to content

Commit

Permalink
ESP32: Lock Thread stack before calling GenericOpenThread::DoInit() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored May 23, 2024
1 parent 0c4287b commit 174f2a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platform/ESP32/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ ThreadStackManagerImpl ThreadStackManagerImpl::sInstance;

CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack()
{
CHIP_ERROR err = CHIP_NO_ERROR;
openthread_init_stack();
return GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>::DoInit(esp_openthread_get_instance());
_LockThreadStack();
err = GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>::DoInit(esp_openthread_get_instance());
_UnlockThreadStack();
return err;
}

CHIP_ERROR ThreadStackManagerImpl::_StartThreadTask()
Expand Down

0 comments on commit 174f2a0

Please sign in to comment.