From e93e4c5a31335d3334ed9acec0c911bd45e51182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 11 Feb 2024 11:52:26 +0100 Subject: [PATCH] ReadWriteBox is Sendable --- GRDB/Utils/ReadWriteBox.swift | 3 ++- TODO.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GRDB/Utils/ReadWriteBox.swift b/GRDB/Utils/ReadWriteBox.swift index 1037ef8b3..2c0cd88f8 100644 --- a/GRDB/Utils/ReadWriteBox.swift +++ b/GRDB/Utils/ReadWriteBox.swift @@ -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 { +final class ReadWriteBox: @unchecked Sendable { + // @unchecked because `_wrappedValue` is protected by `queue` private var _wrappedValue: T private var queue: DispatchQueue diff --git a/TODO.md b/TODO.md index c9ed6dceb..84ccdb2ec 100644 --- a/TODO.md +++ b/TODO.md @@ -110,7 +110,7 @@ - [ ] GRDB7: Sendable: ValueObservationScheduler (8429eb68) - [X] GRDB7: Sendable: DatabaseCollation (4d9d67dd) - [X] GRDB7: Sendable: LogErrorFunction (f362518d) -- [ ] GRDB7: Sendable: ReadWriteBox (57a86a0e) +- [X] GRDB7: Sendable: ReadWriteBox (57a86a0e) - [ ] GRDB7: Sendable: Pool (f13b2d2e) - [ ] GRDB7: Sendable: OnDemandFuture fulfill (2aabc4c1) - [ ] GRDB7: Sendable: WALSnapshotTransaction (7fd34012)