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 6dfba51
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

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

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

0 comments on commit 6dfba51

Please sign in to comment.