< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd002/suspendthrd002.cpp
Print this page
rev 52185 : 8212148: Remove remaining NSK_CPP_STUBs
Summary: Remove remaining macros
Reviewed-by: amenkov, phh
*** 73,84 ****
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))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Let thread to run and finish\n");
--- 73,83 ----
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(jvmti->SuspendThread(testedThread))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Let thread to run and finish\n");
*** 102,122 ****
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))) {
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_DISPLAY0("Let debugee to finish\n");
if (!nsk_jvmti_resumeSync())
return;
--- 101,120 ----
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(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(jni->DeleteGlobalRef(testedThread));
}
NSK_DISPLAY0("Let debugee to finish\n");
if (!nsk_jvmti_resumeSync())
return;
*** 127,137 ****
/** 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)) {
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);
}
--- 125,135 ----
/** THREAD_END callback. */
JNIEXPORT void JNICALL
callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
/* check if event is for tested thread */
if (thread != NULL &&
! 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,189 ****
/* 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)))
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))))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
--- 166,185 ----
/* add specific capabilities for suspending thread */
{
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
! 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(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
< prev index next >