OSDN Git Service

Improve "No new threads in -Xzygote mode" message to include thread name.
authorBrian Carlstrom <bdc@google.com>
Wed, 1 Dec 2010 21:46:50 +0000 (13:46 -0800)
committerBrian Carlstrom <bdc@google.com>
Wed, 1 Dec 2010 22:01:42 +0000 (14:01 -0800)
Change-Id: I5335d86dc1e4cd3f7fd4270ff1f10cdc70f87e92

vm/Thread.c

index ccfbc9b..c2e11c8 100644 (file)
@@ -1416,13 +1416,15 @@ bool dvmCreateInterpThread(Object* threadObj, int reqStackSize)
                     gDvm.offJavaLangThread_name);
         char* threadName = dvmCreateCstrFromString(nameStr);
         bool profilerThread = strcmp(threadName, "SamplingProfiler") == 0;
-        free(threadName);
         if (!profilerThread) {
-            dvmThrowException("Ljava/lang/IllegalStateException;",
-                "No new threads in -Xzygote mode");
+            dvmThrowExceptionFmt("Ljava/lang/IllegalStateException;",
+                "No new threads in -Xzygote mode. "
+                "Found thread named '%s'", threadName);
 
+            free(threadName);
             goto fail;
         }
+        free(threadName);
     }
 
     self = dvmThreadSelf();