ReadWriteBox is Sendable

This commit is contained in:
Gwendal Roué committed 2024-02-11 16:56:21 +01:00
1 parent e26cceb4a9
commit 7a4b8d7aa5
1 file changed
+2 -1
+2 -1
View File
@@ -3,7 +3,8 @@ import Dispatch
/// A ReadWriteBox grants multiple readers and single-writer guarantees on a
/// value. It is backed by a concurrent DispatchQueue.
@propertyWrapper
final class ReadWriteBox<T> {
final class ReadWriteBox<T: Sendable>: @unchecked Sendable {
// @unchecked because `_wrappedValue` is protected by `queue`
private var _wrappedValue: T
private var queue: DispatchQueue