< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/ji05t001.c

Print this page

        

@@ -331,12 +331,15 @@
     checkIntercept(0, 0, 1); /* expected interceptions: 1 */
     /* check the current interception set in another JVMTI env */
     checkIntercept(1, 0, 1); /* expected interceptions: 1 */
     NSK_DISPLAY0("\n<<< TEST CASE #4) done\n");
 
-    NSK_DISPLAY1("\nagent A: returning exit code %d\n",
+    NSK_DISPLAY1("\nagent A: detaching and returning exit code %d\n",
         exitCode);
+    if ((res = JNI_ENV_PTR(vm)->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0) {
+        NSK_COMPLAIN1("TEST WARNING: agent A: DetachCurrentThread() returns: %d\n", res);
+    }
     return exitCode;
 }
 
 static int agentB(void *context) {
     JNIEnv *env;

@@ -391,12 +394,15 @@
     checkIntercept(1, 1, 1); /* expected interceptions: 1 */
     NSK_DISPLAY0("\n<<< TEST CASE #3) done\n");
 
     redir[1] = 1;
 
-    NSK_DISPLAY1("\nagent B: returning exit code %d\n",
+    NSK_DISPLAY1("\nagent B: detaching and returning exit code %d\n",
         exitCode);
+    if ((res = JNI_ENV_PTR(vm)->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0) {
+        NSK_COMPLAIN1("TEST WARNING: agent B: DetachCurrentThread() returns: %d\n", res);
+    }
     return exitCode;
 }
 /*********************/
 
 /* callback functions */
< prev index next >