Skip to content

Commit

Permalink
Move processing out of storage delegate queue dispatch_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jtung-apple committed Apr 12, 2024
1 parent a6ef665 commit 5b689c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller

- (void)fetchAttributeDataForAllDevices:(MTRDeviceControllerDataStoreClusterDataHandler)clusterDataHandler
{
__block NSDictionary<NSNumber *, NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> *> * clusterDataByNode = nil;
__block NSDictionary<NSString *, id> * dataStoreSecureLocalValues = nil;
dispatch_sync(_storageDelegateQueue, ^{
if ([self->_storageDelegate respondsToSelector:@selector(valuesForController:securityLevel:sharingType:)]) {
NSDictionary<NSString *, id> * dataStoreSecureLocalValues = [self->_storageDelegate valuesForController:self->_controller securityLevel:MTRStorageSecurityLevelSecure sharingType:MTRStorageSharingTypeNotShared];

clusterDataByNode = [self _getClusterDataFromSecureLocalValues:dataStoreSecureLocalValues];
dataStoreSecureLocalValues = [self->_storageDelegate valuesForController:self->_controller securityLevel:MTRStorageSecurityLevelSecure sharingType:MTRStorageSharingTypeNotShared];
}
});

clusterDataHandler(clusterDataByNode);
if (dataStoreSecureLocalValues.count) {
clusterDataHandler([self _getClusterDataFromSecureLocalValues:dataStoreSecureLocalValues]);
}
}

- (nullable MTRCASESessionResumptionInfo *)findResumptionInfoByNodeID:(NSNumber *)nodeID
Expand Down

0 comments on commit 5b689c3

Please sign in to comment.