< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach042/attach042Agent00.cpp
Print this page
rev 51942 : [mq]: refactor
*** 60,70 ****
jint threadsCount = 0;
jthread* threads = NULL;
int i;
int startedThreadWasFound = 0;
! if(!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetAllThreads, jvmti, &threadsCount, &threads))) {
NSK_COMPLAIN1("%s: failed to get all threads\n", agentName);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_THREAD_START, 0, jvmti, jni);
return;
}
--- 60,70 ----
jint threadsCount = 0;
jthread* threads = NULL;
int i;
int startedThreadWasFound = 0;
! if(!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threadsCount, &threads))) {
NSK_COMPLAIN1("%s: failed to get all threads\n", agentName);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_THREAD_START, 0, jvmti, jni);
return;
}
*** 83,93 ****
if (!strcmp(threadName, startedThreadName)) {
startedThreadWasFound = 1;
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadState, jvmti, threads[i], &threadState))) {
NSK_COMPLAIN2("%s: failed to get status of thread '%s'\n", agentName, threadName);
nsk_jvmti_aod_deallocate(jvmti, (unsigned char*)threads);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_THREAD_START, 0, jvmti, jni);
return;
}
--- 83,93 ----
if (!strcmp(threadName, startedThreadName)) {
startedThreadWasFound = 1;
}
! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threads[i], &threadState))) {
NSK_COMPLAIN2("%s: failed to get status of thread '%s'\n", agentName, threadName);
nsk_jvmti_aod_deallocate(jvmti, (unsigned char*)threads);
nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_THREAD_START, 0, jvmti, jni);
return;
}
*** 134,144 ****
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
return JNI_ERR;
memset(&eventCallbacks,0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = threadStartHandler;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti, &eventCallbacks, sizeof(eventCallbacks))) ) {
return JNI_ERR;
}
if (!(nsk_jvmti_aod_enableEvent(jvmti, JVMTI_EVENT_THREAD_START))) {
return JNI_ERR;
--- 134,144 ----
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
return JNI_ERR;
memset(&eventCallbacks,0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = threadStartHandler;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
return JNI_ERR;
}
if (!(nsk_jvmti_aod_enableEvent(jvmti, JVMTI_EVENT_THREAD_START))) {
return JNI_ERR;
< prev index next >