From 6dfba51687ba7850538a899e126c52e88c5ca5b7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 10 Sep 2024 17:10:30 -0400 Subject: [PATCH] Address review comments. --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 5103f123035f11..efec55246e1694 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -112,6 +112,10 @@ using namespace chip::Tracing::DarwinFramework; +@interface MTRDeviceController () +@property (readwrite, nonatomic) NSUUID * uniqueIdentifier; +@end + @implementation MTRDeviceController { chip::Controller::DeviceCommissioner * _cppCommissioner; chip::Credentials::PartialDACVerifier * _partialDACVerifier; @@ -154,7 +158,7 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended uniqueIdentifier:(NSUUID // nothing, as superclass of MTRDeviceController is NSObject } - _uniqueIdentifier = uniqueIdentifier; + self.uniqueIdentifier = uniqueIdentifier; _underlyingDeviceMapLock = OS_UNFAIR_LOCK_INIT; @@ -165,7 +169,8 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended uniqueIdentifier:(NSUUID // All synchronous suspend/resume activity has to be protected by // @synchronized(self), so that parts of suspend/resume can't - // interleave with each other. + // interleave with each other. Using @synchronized here because + // MTRDevice may call isSuspended. _suspended = startSuspended; _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; @@ -354,7 +359,6 @@ - (BOOL)isRunning - (BOOL)isSuspended { - // Using @synchronized here because MTRDevice may call isSuspended. @synchronized(self) { return _suspended; }