< prev index next >

src/java.base/share/native/libjli/java.c

Print this page

        

@@ -251,10 +251,11 @@
         SetJvmEnvironment(argc,argv);
     }
 
     ifn.CreateJavaVM = 0;
     ifn.GetDefaultJavaVMInitArgs = 0;
+    ifn.SetNativeThreadName0 = 0;
 
     if (JLI_IsTraceLauncher()) {
         start = CounterGet();
     }
 

@@ -329,10 +330,11 @@
         if ((*vm)->DetachCurrentThread(vm) != JNI_OK) { \
             JLI_ReportErrorMessage(JVM_ERROR2); \
             ret = 1; \
         } \
         if (JNI_TRUE) { \
+            ifn.SetNativeThreadName0("DestroyJavaVM"); \
             (*vm)->DestroyJavaVM(vm); \
             return ret; \
         } \
     } while (JNI_FALSE)
 

@@ -486,10 +488,13 @@
 
     /* Build platform specific argument array */
     mainArgs = CreateApplicationArgs(env, argv, argc);
     CHECK_EXCEPTION_NULL_LEAVE(mainArgs);
 
+    /* Set native thread name */
+    ifn.SetNativeThreadName0("main");
+
     /* Invoke main method. */
     (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
 
     /*
      * The launcher's exit code (in the absence of calls to
< prev index next >