Skip to content

Commit

Permalink
cli: lock Thread stack when calling OpenThread API (project-chip#13806)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjc13 authored and selissia committed Jan 28, 2022
1 parent 42bedcf commit be276da
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 be276da

Please sign in to comment.