Skip to content

Commit

Permalink
Improve description for MTRDevice. (project-chip#34857)
Browse files Browse the repository at this point in the history
* apply changes from PR project-chip#34797 to to concrete class

* Improve description for MTRDevice.

Includes various information that wasn't included before but probably should be.

* Address review comments.

---------

Co-authored-by: Kiel Oleson <kielo@apple.com>
  • Loading branch information
2 people authored and austina-csa committed Aug 12, 2024
1 parent e0f9bd4 commit ffbf7da
Show file tree
Hide file tree
Showing 6 changed files with 495 additions and 53 deletions.
3 changes: 3 additions & 0 deletions src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ MTR_TESTABLE
- (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID
workItemData:(id)opaqueWorkItemData;

// Returns current count of queued items.
- (NSUInteger)itemCount;

/// Cancels and removes all work items.
- (void)invalidate;
@end
Expand Down
6 changes: 6 additions & 0 deletions src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,12 @@ - (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id
return NO;
}

- (NSUInteger)itemCount
{
std::lock_guard lock(_lock);
return _items.count;
}

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit ffbf7da

Please sign in to comment.