mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Documentation
This commit is contained in:
1 parent
4e26e8e744
commit
17864d3dcc
2 files changed
+14
-3
No files matched your search
@@ -631,9 +631,17 @@ public final class Database {
|
||||
|
||||
// MARK: - Lock Prevention
|
||||
|
||||
/// Release any database lock, as soon as possible, at any cost.
|
||||
/// Starts preventing database locks.
|
||||
///
|
||||
/// See https://www.sqlite.org/lockingv3.html
|
||||
/// This method can be called from any thread.
|
||||
///
|
||||
/// During lock prevention, any lock is released as soon as possible, and
|
||||
/// lock acquisition is prevented.
|
||||
///
|
||||
/// All database accesses may throw a DatabaseError of code
|
||||
/// `SQLITE_INTERRUPT`, or `SQLITE_ABORT`, except reads in WAL mode.
|
||||
///
|
||||
/// Lock prevention ends with stopPreventingLock().
|
||||
func startPreventingLock() {
|
||||
preventsLock.write { preventsLock in
|
||||
if preventsLock {
|
||||
@@ -667,6 +675,9 @@ public final class Database {
|
||||
}
|
||||
}
|
||||
|
||||
/// Ends lock prevention. See startPreventingLock().
|
||||
///
|
||||
/// This method can be called from any thread.
|
||||
func stopPreventingLock() {
|
||||
preventsLock.write { preventsLock in
|
||||
preventsLock = false
|
||||
|
||||
@@ -94,7 +94,7 @@ public protocol DatabaseReader: AnyObject {
|
||||
/// lock acquisition is prevented.
|
||||
///
|
||||
/// All database accesses may throw a DatabaseError of code
|
||||
/// `SQLITE_INTERRUPT`, or `SQLITE_ABORT`.
|
||||
/// `SQLITE_INTERRUPT`, or `SQLITE_ABORT`, except reads in WAL mode.
|
||||
///
|
||||
/// Lock prevention ends with stopPreventingLock().
|
||||
func startPreventingLock()
|
||||
|
||||
Reference in new issue
Block a user