From 7eb861f1b26604f2a982c9f224b24081e229c925 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 5103f123035f11..c2c600f6b789b3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -141,6 +141,8 @@ @implementation MTRDeviceController { os_unfair_lock _assertionLock; } +@property (readwrite, nonatomic) NSUUID * uniqueIdentifier; + @synthesize uniqueIdentifier = _uniqueIdentifier; - (os_unfair_lock_t)deviceMapLock @@ -154,7 +156,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 +167,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 +357,6 @@ - (BOOL)isRunning - (BOOL)isSuspended { - // Using @synchronized here because MTRDevice may call isSuspended. @synchronized(self) { return _suspended; }