Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Sep 10, 2024
1 parent 9ebd5e9 commit 7eb861f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ @implementation MTRDeviceController {
os_unfair_lock _assertionLock;
}

@property (readwrite, nonatomic) NSUUID * uniqueIdentifier;

@synthesize uniqueIdentifier = _uniqueIdentifier;

- (os_unfair_lock_t)deviceMapLock
Expand All @@ -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;

Expand All @@ -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];
Expand Down Expand Up @@ -354,7 +357,6 @@ - (BOOL)isRunning

- (BOOL)isSuspended
{
// Using @synchronized here because MTRDevice may call isSuspended.
@synchronized(self) {
return _suspended;
}
Expand Down

0 comments on commit 7eb861f

Please sign in to comment.