From e53484da4457a4c0ee17956b3f7637fd76cc1642 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Feb 2024 11:54:39 -0500 Subject: [PATCH] Mark ServerEndpoint Darwin objects as Sendable in Swift. (#32088) These are allowed to be accessed concurrently from multiple threads, so are Sendable. --- src/darwin/Framework/CHIP/ServerEndpoint/MTRAccessGrant.h | 1 + src/darwin/Framework/CHIP/ServerEndpoint/MTRDeviceTypeRevision.h | 1 + src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.h | 1 + src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.h | 1 + src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.h | 1 + 5 files changed, 5 insertions(+) diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRAccessGrant.h b/src/darwin/Framework/CHIP/ServerEndpoint/MTRAccessGrant.h index e0b25449755f16..e0dc4bd052f0f4 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRAccessGrant.h +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRAccessGrant.h @@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN * An access grant, which can be represented as an entry in the Matter Access * Control cluster. */ +NS_SWIFT_SENDABLE MTR_NEWLY_AVAILABLE @interface MTRAccessGrant : NSObject diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRDeviceTypeRevision.h b/src/darwin/Framework/CHIP/ServerEndpoint/MTRDeviceTypeRevision.h index 7f4f88b0cfd643..dc95ddcddaeaeb 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRDeviceTypeRevision.h +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRDeviceTypeRevision.h @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN * A representation of a "device type revision" in the sense used in the Matter * specification. This has an identifier and a version number. */ +NS_SWIFT_SENDABLE MTR_NEWLY_AVAILABLE @interface MTRDeviceTypeRevision : NSObject diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.h b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.h index 46e95bfb39a7bd..7d8c27b74b55d3 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.h +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.h @@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN * MTRDeviceController. An attribute has an identifier and a value, and may or * may not be writable. */ +NS_SWIFT_SENDABLE MTR_NEWLY_AVAILABLE @interface MTRServerAttribute : NSObject diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.h b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.h index 48604dd2a76797..02b0f4b274374d 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.h +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.h @@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN /** * A representation of a server cluster implemented by an MTRDeviceController. */ +NS_SWIFT_SENDABLE MTR_NEWLY_AVAILABLE @interface MTRServerCluster : NSObject diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.h b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.h index 13dbe8454d759e..9716692ea8895d 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.h +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.h @@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN /** * A representation of an endpoint implemented by an MTRDeviceController. */ +NS_SWIFT_SENDABLE MTR_NEWLY_AVAILABLE @interface MTRServerEndpoint : NSObject