OSDN Git Service

Don't assert that all threads have stopped.
authorAndy McFadden <fadden@android.com>
Tue, 4 Aug 2009 23:38:40 +0000 (16:38 -0700)
committerAndy McFadden <fadden@android.com>
Wed, 5 Aug 2009 14:29:53 +0000 (07:29 -0700)
If assertions were enabled and we had a daemon thread running, the VM
would fail on exit.

vm/Thread.c

index 3102a47..2e982d8 100644 (file)
@@ -410,8 +410,12 @@ bool dvmThreadObjStartup(void)
 void dvmThreadShutdown(void)
 {
     if (gDvm.threadList != NULL) {
-        assert(gDvm.threadList->next == NULL);
-        assert(gDvm.threadList->prev == NULL);
+        /*
+         * If we walk through the thread list and try to free the
+         * lingering thread structures (which should only be for daemon
+         * threads), the daemon threads may crash if they execute before
+         * the process dies.  Let them leak.
+         */
         freeThread(gDvm.threadList);
         gDvm.threadList = NULL;
     }