How does 'finally' block in android run
<p>In android, for code under a finally block:</p>

<pre><code>1548 finally {
1549                /*
1550                 * clean-up everything...
1551                 */
1552                synchronized (sGLThreadManager) {
1553                    stopEglSurfaceLocked();
1554                    stopEglContextLocked();
1555                }
1556            }
</code></pre>

<p>Does it mean it will be run by the 'FinalizerDaemon'?</p>

<p>And what does it mean when the trace.txt shows FinalizerDaemon is waiting on a ReferenceQueue?</p>

<pre><code>  "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 &lt;0x416da5d0&gt; (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)
</code></pre>
