Skip to content

Commit

Permalink
Remove acquiring matter context lock for canceling TimerExpiredCallba…
Browse files Browse the repository at this point in the history
…ck (#26578)

* Remove acquiring matter context lock for canceling TimerExpiredCallback

* Update comment to reflect update to code
  • Loading branch information
tehampson authored and pull[bot] committed Jul 20, 2023
1 parent 9ab2bc7 commit 1398306
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/platform/Linux/bluez/ChipDeviceScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,10 @@ ChipDeviceScanner::~ChipDeviceScanner()
StopScan();

// mTimerExpired should only be set to true in the TimerExpiredCallback, which means we are in that callback
// right now so there is no need to cancel the timer. Doing so would result in deadlock trying to aquire the
// chip stack lock which we already currently have.
// right now so there is no need to cancel the timer.
if (!mTimerExpired)
{
// In case the timeout timer is still active
DeviceLayer::PlatformMgr().LockChipStack();
chip::DeviceLayer::SystemLayer().CancelTimer(TimerExpiredCallback, this);
DeviceLayer::PlatformMgr().UnlockChipStack();
}

g_object_unref(mManager);
Expand Down

0 comments on commit 1398306

Please sign in to comment.