diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index c41f5c3bb47fb4..c1d6d25414eef7 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -105,6 +106,7 @@ static ::chip::app::CircularEventBuffer sLoggingBuffer[CHIP_NUM_EVENT_LOGGING_BU CHIP_ERROR Server::Init(const ServerInitParams & initParams) { ChipLogProgress(AppServer, "Server initializing..."); + assertChipStackLockedByCurrentThread(); CASESessionManagerConfig caseSessionManagerConfig; DeviceLayer::DeviceInfoProvider * deviceInfoprovider = nullptr; @@ -461,6 +463,7 @@ void Server::ScheduleFactoryReset() void Server::Shutdown() { + assertChipStackLockedByCurrentThread(); PlatformMgr().RemoveEventHandler(OnPlatformEventWrapper, 0); mCASEServer.Shutdown(); mCASESessionManager.Shutdown();