< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent00.cpp
Print this page
rev 51942 : [mq]: refactor
*** 55,77 ****
if (!nsk_jvmti_aod_getClassName(jvmti, klass, className)) {
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_CLASS_LOAD, 0, jvmti, jni);
return;
}
! if (NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
! RawMonitorEnter, jvmti, eventsCounterMonitor))) {
eventsCounter++;
NSK_DISPLAY3("%s: ClassLoad event received for class '%s (eventsCounter: %d)'\n", agentName, className, eventsCounter);
if (eventsCounter == EXPECTED_EVENTS_NUMBER) {
NSK_DISPLAY2("%s: all expected events were received (eventsCounter: %d)\n", agentName, eventsCounter);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_CLASS_LOAD, success, jvmti, jni);
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, eventsCounterMonitor))) {
success = 0;
}
} else {
success = 0;
}
--- 55,76 ----
if (!nsk_jvmti_aod_getClassName(jvmti, klass, className)) {
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_CLASS_LOAD, 0, jvmti, jni);
return;
}
! if (NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventsCounterMonitor))) {
eventsCounter++;
NSK_DISPLAY3("%s: ClassLoad event received for class '%s (eventsCounter: %d)'\n", agentName, className, eventsCounter);
if (eventsCounter == EXPECTED_EVENTS_NUMBER) {
NSK_DISPLAY2("%s: all expected events were received (eventsCounter: %d)\n", agentName, eventsCounter);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_CLASS_LOAD, success, jvmti, jni);
}
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventsCounterMonitor))) {
success = 0;
}
} else {
success = 0;
}
*** 107,123 ****
return JNI_ERR;
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
return JNI_ERR;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor, jvmti, "attach045-agent00-eventsCounterMonitor", &eventsCounterMonitor))) {
return JNI_ERR;
}
memset(&eventCallbacks,0, sizeof(eventCallbacks));
eventCallbacks.ClassLoad = classLoadHandler;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti, &eventCallbacks, sizeof(eventCallbacks))) ) {
return JNI_ERR;
}
if (!(nsk_jvmti_aod_enableEvent(jvmti, JVMTI_EVENT_CLASS_LOAD))) {
return JNI_ERR;
--- 106,122 ----
return JNI_ERR;
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
return JNI_ERR;
! if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("attach045-agent00-eventsCounterMonitor", &eventsCounterMonitor))) {
return JNI_ERR;
}
memset(&eventCallbacks,0, sizeof(eventCallbacks));
eventCallbacks.ClassLoad = classLoadHandler;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
return JNI_ERR;
}
if (!(nsk_jvmti_aod_enableEvent(jvmti, JVMTI_EVENT_CLASS_LOAD))) {
return JNI_ERR;
< prev index next >