mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Sendable annotations
This commit is contained in:
1 parent
9b93ef7907
commit
022487d360
3 files changed
+7
-5
No files matched your search
@@ -223,7 +223,7 @@ final class SerializedDatabase {
|
||||
}
|
||||
|
||||
/// Schedules database operations for execution, and returns immediately.
|
||||
func async(_ block: @escaping (Database) -> Void) {
|
||||
func async(_ block: @escaping @Sendable (Database) -> Void) {
|
||||
queue.async {
|
||||
block(self.db)
|
||||
self.preconditionNoUnsafeTransactionLeft(self.db)
|
||||
|
||||
@@ -36,7 +36,7 @@ extension TransactionClock where Self == CustomTransactionClock {
|
||||
///
|
||||
/// It is also called when the ``Database/transactionDate`` property is
|
||||
/// called, and the database connection is not in a transaction.
|
||||
public static func custom(_ now: @escaping (Database) throws -> Date) -> Self {
|
||||
public static func custom(_ now: @escaping @Sendable (Database) throws -> Date) -> Self {
|
||||
CustomTransactionClock(now)
|
||||
}
|
||||
}
|
||||
@@ -53,9 +53,9 @@ public struct DefaultTransactionClock: TransactionClock {
|
||||
|
||||
/// A custom transaction clock.
|
||||
public struct CustomTransactionClock: TransactionClock {
|
||||
let _now: (Database) throws -> Date
|
||||
let _now: @Sendable (Database) throws -> Date
|
||||
|
||||
public init(_ now: @escaping (Database) throws -> Date) {
|
||||
public init(_ now: @escaping @Sendable (Database) throws -> Date) {
|
||||
self._now = now
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
/// Yes, this is an awfully complex logic.
|
||||
///
|
||||
/// See <https://www.sqlite.org/c3ref/snapshot.html>.
|
||||
final class WALSnapshot: Sendable {
|
||||
final class WALSnapshot: @unchecked Sendable {
|
||||
// Unchecked because of `sqliteSnapshot`.
|
||||
|
||||
let sqliteSnapshot: UnsafeMutablePointer<sqlite3_snapshot>
|
||||
|
||||
init(_ db: Database) throws {
|
||||
|
||||
Reference in new issue
Block a user