mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Merge pull request #1797 from groue/dev/cancellation-fix
Fix race condition regarding Task cancellation
This commit is contained in:
2 files changed
+2
No files matched your search
@@ -803,6 +803,7 @@ extension DatabasePool: DatabaseWriter {
|
||||
try Task.checkCancellation()
|
||||
return try writer.sync { db in
|
||||
defer {
|
||||
cancelMutex.store(nil)
|
||||
db.uncancel()
|
||||
}
|
||||
cancelMutex.store(db.cancel)
|
||||
|
||||
@@ -256,6 +256,7 @@ final class SerializedDatabase {
|
||||
return try await withTaskCancellationHandler {
|
||||
try await actor.execute {
|
||||
defer {
|
||||
cancelMutex.store(nil)
|
||||
db.uncancel()
|
||||
preconditionNoUnsafeTransactionLeft(db)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user