< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/ex03t001.cpp

Print this page
rev 52050 : [mq]: refactor

*** 59,78 **** } else { eventReceived2 = JNI_TRUE; } /* Notify main agent thread */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorNotify, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } } jboolean isClassUnloadingEnabled() { --- 59,75 ---- } else { eventReceived2 = JNI_TRUE; } /* Notify main agent thread */ ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorNotify(eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) { nsk_jvmti_setFailStatus(); } } jboolean isClassUnloadingEnabled() {
*** 82,93 **** jboolean enabled = JNI_FALSE; jvmtiError err; NSK_DISPLAY0("Get extension functions list\n"); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetExtensionFunctions, jvmti, &extCount, &extList))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } for (i = 0; i < extCount; i++) { --- 79,89 ---- jboolean enabled = JNI_FALSE; jvmtiError err; NSK_DISPLAY0("Get extension functions list\n"); ! if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionFunctions(&extCount, &extList))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } for (i = 0; i < extCount; i++) {
*** 115,136 **** jint extCount, i; jvmtiExtensionEventInfo* extList; jboolean found = JNI_FALSE; NSK_DISPLAY0("Get extension events list\n"); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetExtensionEvents, jvmti, &extCount, &extList))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } for (i = 0; i < extCount; i++) { if (strcmp(extList[i].id, (char*)"com.sun.hotspot.events.ClassUnload") == 0) { found = JNI_TRUE; if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(SetExtensionEventCallback, jvmti, extList[i].extension_event_index, enable ? (jvmtiExtensionEvent)ClassUnload : NULL ))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } eventEnabled = enable; --- 111,131 ---- jint extCount, i; jvmtiExtensionEventInfo* extList; jboolean found = JNI_FALSE; NSK_DISPLAY0("Get extension events list\n"); ! if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionEvents(&extCount, &extList))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } for (i = 0; i < extCount; i++) { if (strcmp(extList[i].id, (char*)"com.sun.hotspot.events.ClassUnload") == 0) { found = JNI_TRUE; if (!NSK_JVMTI_VERIFY( ! jvmti->SetExtensionEventCallback(extList[i].extension_event_index, enable ? (jvmtiExtensionEvent)ClassUnload : NULL ))) { nsk_jvmti_setFailStatus(); return JNI_FALSE; } eventEnabled = enable;
*** 173,192 **** NSK_DISPLAY0("Let debugee to unload ex03t001a class.\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) break; /* Wait for notifying from event's thread */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(RawMonitorWait, jvmti, eventMon, timeout))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } NSK_DISPLAY0("Wait for loading of ex03t001b class.\n"); if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout))) --- 168,184 ---- NSK_DISPLAY0("Let debugee to unload ex03t001a class.\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) break; /* Wait for notifying from event's thread */ ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(eventMon, timeout))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) { nsk_jvmti_setFailStatus(); } NSK_DISPLAY0("Wait for loading of ex03t001b class.\n"); if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
*** 200,219 **** NSK_DISPLAY0("Let debugee to unload ex03t001b class.\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) return; /* Wait during 10 secs for notifying from event's thread */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(RawMonitorWait, jvmti, eventMon, 10000))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) { nsk_jvmti_setFailStatus(); } if (eventReceived1 == JNI_FALSE) { nsk_jvmti_setFailStatus(); --- 192,208 ---- NSK_DISPLAY0("Let debugee to unload ex03t001b class.\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) return; /* Wait during 10 secs for notifying from event's thread */ ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(eventMon, 10000))) { nsk_jvmti_setFailStatus(); } ! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) { nsk_jvmti_setFailStatus(); } if (eventReceived1 == JNI_FALSE) { nsk_jvmti_setFailStatus();
*** 228,238 **** if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout))) return; } while (0); ! NSK_TRACE(NSK_CPP_STUB2(DestroyRawMonitor, jvmti, eventMon)); NSK_DISPLAY0("Let debugee to finish\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) return; } --- 217,227 ---- if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout))) return; } while (0); ! NSK_TRACE(jvmti->DestroyRawMonitor(eventMon)); NSK_DISPLAY0("Let debugee to finish\n"); if (!NSK_VERIFY(nsk_jvmti_resumeSync())) return; }
*** 260,271 **** if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) return JNI_ERR; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(CreateRawMonitor, jvmti, "eventMon", &eventMon))) { return JNI_ERR; } if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR; --- 249,259 ---- if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) return JNI_ERR; ! if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("eventMon", &eventMon))) { return JNI_ERR; } if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR;
< prev index next >