ReadWriteBox is Sendable

This commit is contained in:
Gwendal Roué committed 2024-07-27 16:37:33 +02:00
1 parent 40090dbe00
commit 57a86a0e2a
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