我试图在我的应用程序中调试一个问题。唯一的问题可能是我的线程可能已经挂在某个地方(但它应该在等待)..当仔细查看 duumpstate 日志时,我注意到以下日志
命令行:com.test.myapp
达尔维克线程:(互斥体:tll=0 tsl=0 tscl=0 ghl=0)。. .
"pool-2-thread-1" prio=10 tid=20 WAIT
| group="main" sCount=1 dsCount=0 obj=0x426986e0 self=0x5ae85520
| sysTid=3211 nice=-8 sched=0/0 cgrp=apps handle=1520669672
| state=S schedstat=( 9170292 19258957 35 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x4268ed88> (a java.lang.VMThread) held by tid=20 (pool-2-thread-1)
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$ConditionObject.await(AbstractQueuedSynchronizer.java:2019)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1052)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:780)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
上面的线指向我怀疑的线程。转储状态日志中的 DALVIK THREADS 是什么意思?那是当前活着的线程还是活着的线程+已经活着的线程?state=S schedstat=( 9170292 19258957 35 ) utm=0 stm=0 core=0 是什么意思?是暂停状态吗?等待 <0x4268ed88> (a java.lang.VMThread) --> 这是什么意思?它在等待和活着吗?