-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Hello,
I've just realized that I have a long suspending query when calling
kStoreDbIface.userInfo.get()
// commonMain
interface KStoreDbIface {
val userInfo: KStore<UserInfoV1>
}
// android
class KStoreDb(context: Context) : KStoreDbIface {
override val userInfo: KStore<UserInfoV1> = storeOf(
file = Path("${context.filesDir}/user_info.json"),
version = 1,
)
...
}
tested only on Android.
Do you have any idea what might be happening?
My idea is that I'm calling from two coroutines the same kStoreDbIface.userInfo.get(), causing Mutex.withLock to suspend.
If any other coroutine already holds this lock, then another coroutine calling get() will suspend until the first one releases the lock.
Regards!
Metadata
Metadata
Assignees
Labels
No labels