< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd002/suspendthrd002.cpp
Print this page
rev 52185 : [mq]: refactor
@@ -73,12 +73,11 @@
NSK_DISPLAY1("Enable event: %s\n", "THREAD_END");
if (!nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT, eventsList, NULL))
return;
NSK_DISPLAY1("Suspend thread: %p\n", (void*)testedThread);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, testedThread))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(testedThread))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Let thread to run and finish\n");
@@ -102,21 +101,20 @@
NSK_DISPLAY1("Disable event: %s\n", "THREAD_END");
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL))
return;
NSK_DISPLAY1("Resume thread: %p\n", (void*)testedThread);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, testedThread))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(testedThread))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Wait for thread to finish\n");
if (!nsk_jvmti_waitForSync(timeout))
return;
NSK_DISPLAY0("Delete thread reference\n");
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread));
+ NSK_TRACE(jni->DeleteGlobalRef(testedThread));
}
NSK_DISPLAY0("Let debugee to finish\n");
if (!nsk_jvmti_resumeSync())
return;
@@ -127,11 +125,11 @@
/** THREAD_END callback. */
JNIEXPORT void JNICALL
callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
/* check if event is for tested thread */
if (thread != NULL &&
- NSK_CPP_STUB3(IsSameObject, jni, testedThread, thread)) {
+ jni->IsSameObject(testedThread, thread)) {
NSK_DISPLAY1(" ... received THREAD_END event for tested thread: %p\n", (void*)thread);
eventsReceived++;
} else {
NSK_DISPLAY1(" ... received THREAD_END event for unknown thread: %p\n", (void*)thread);
}
@@ -168,22 +166,20 @@
/* add specific capabilities for suspending thread */
{
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
/* set callbacks for THREAD_END event */
{
jvmtiEventCallbacks callbacks;
memset(&callbacks, 0, sizeof(callbacks));
callbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, sizeof(callbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
< prev index next >