我的應用程序使用sqlcipher數據庫。它使用光標加載器從數據庫查詢數據Android主線程在db操作中被鎖定
我正在運行到ANR。見下面ANR跟蹤
我在這裏試圖理解的是,爲什麼試圖關閉遊標的主線程自己被阻塞。這個問題隨機發生,我還沒有想出一個可重複的方案。我懷疑這是否與sqlcipher的遊標實現相關的鎖定問題。
"main" prio=5 tid=1 WAIT
| group="main" sCount=1 dsCount=0 obj=0x415979a0 self=0x4000b010
| sysTid=9804 nice=0 sched=0/0 cgrp=apps handle=1075102172
| state=S schedstat=(0 0 0) utm=3670 stm=710 core=1
at java.lang.Object.wait(Native Method)
waiting on (a java.lang.VMThread) held by tid=1 (main) at
java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at
java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:810) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:843) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1173) at
java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:198) at
java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:259) at
net.sqlcipher.database.SQLiteDatabase.lock(SQLiteDatabase.java:460) at
net.sqlcipher.database.SQLiteProgram.close(SQLiteProgram.java:294) at
net.sqlcipher.database.SQLiteQuery.close(SQLiteQuery.java:136) at
net.sqlcipher.database.SQLiteCursor.close(SQLiteCursor.java:510) at
android.database.CursorWrapper.close(CursorWrapper.java:49) at
android.database.CursorWrapper.close(CursorWrapper.java:49) at
android.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1860) at
android.database.MergeCursor.close(MergeCursor.java:175) at
android.database.CursorWrapper.close(CursorWrapper.java:49) at
android.content.CursorLoader.deliverResult(CursorLoader.java:117) at
android.content.CursorLoader.deliverResult(CursorLoader.java:43)
我一直在試圖調試的問題,但不知道從哪裏開始
有人可以幫我