在 android 中,对于 finally 块下的代码:
1548 finally {
1549 /*
1550 * clean-up everything...
1551 */
1552 synchronized (sGLThreadManager) {
1553 stopEglSurfaceLocked();
1554 stopEglContextLocked();
1555 }
1556 }
这是否意味着它将由“FinalizerDaemon”运行?
当 trace.txt 显示 FinalizerDaemon 正在等待 ReferenceQueue 时,这意味着什么?
"FinalizerDaemon" daemon prio=5 tid=7 WAIT
| group="system" sCount=1 dsCount=0 obj=0x419d0c60 self=0x50cf3650
| sysTid=3933 nice=0 sched=0/0 cgrp=apps handle=1086157112
| schedstat=( 0 0 0 ) utm=32 stm=9 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x416da5d0> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)
at java.lang.Thread.run(Thread.java:856)