Skip to content

Commit

Permalink
cli: lock Thread stack when calling OpenThread API
Browse files Browse the repository at this point in the history
  • Loading branch information
gjc13 committed Jan 21, 2022
1 parent dd209ce commit c057cc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/shell/shell_common/cmd_otcli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ CHIP_ERROR cmd_otcli_dispatch(int argc, char ** argv)
}
}
buff_ptr = 0;
chip::DeviceLayer::ThreadStackMgr().LockThreadStack();
#if OPENTHREAD_API_VERSION >= 85
otCliInputLine(buff);
#else
otCliConsoleInputLine(buff, buff_ptr - buff);
#endif
chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack();
exit:
return error;
}
Expand Down

0 comments on commit c057cc1

Please sign in to comment.