writeLock<T> method
Takes a global lock, without starting a transaction.
In most cases, writeTransaction should be used instead.
The lock applies to all SqliteConnection instances for a SqliteDatabase. Locks for separate SqliteDatabase instances on the same database file may be held concurrently.
If a timeout is set and no read connection becomes available in time, an AbortException will be thrown.
Implementation
Future<T> writeLock<T>(Future<T> Function(SqliteWriteContext tx) callback,
{Duration? lockTimeout, String? debugContext}) {
return abortableWriteLock(callback,
debugContext: debugContext, abortTrigger: lockTimeout?.asTimeout);
}