readLock

abstract suspend fun <R> readLock(callback: ThrowableLockCallback<R>): R

Takes a read lock without starting a transaction.

The lock applies only to a single SQLite connection, allowing multiple connections to hold read locks simultaneously.

Return

The result of the callback.

Parameters

callback

The callback to execute while holding the lock.

Throws

If a database error occurs.

If the operation is cancelled.