Skip to content

Commit

Permalink
Make sure that Server init and shutdown happen with the stack lock he…
Browse files Browse the repository at this point in the history
…ld. (#25041)
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 19, 2023
1 parent fd9a345 commit 4037303
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <platform/DeviceControlServer.h>
#include <platform/DeviceInfoProvider.h>
#include <platform/KeyValueStoreManager.h>
#include <platform/LockTracker.h>
#include <protocols/secure_channel/CASEServer.h>
#include <protocols/secure_channel/MessageCounterManager.h>
#include <setup_payload/SetupPayload.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -461,6 +463,7 @@ void Server::ScheduleFactoryReset()

void Server::Shutdown()
{
assertChipStackLockedByCurrentThread();
PlatformMgr().RemoveEventHandler(OnPlatformEventWrapper, 0);
mCASEServer.Shutdown();
mCASESessionManager.Shutdown();
Expand Down

0 comments on commit 4037303

Please sign in to comment.