< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst002/suspendthrdlst002.cpp
Print this page
rev 52185 : 8212148: Remove remaining NSK_CPP_STUBs
Summary: Remove remaining macros
Reviewed-by: amenkov, phh
*** 71,91 ****
{
jvmtiError* results = NULL;
int i;
NSK_DISPLAY1("Allocate threads array: %d threads\n", threadsCount);
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
(unsigned char**)&threads))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
NSK_DISPLAY1("Allocate results array: %d threads\n", threadsCount);
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jvmtiError)),
(unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
--- 71,89 ----
{
jvmtiError* results = NULL;
int i;
NSK_DISPLAY1("Allocate threads array: %d threads\n", threadsCount);
! if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jthread)),
(unsigned char**)&threads))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
NSK_DISPLAY1("Allocate results array: %d threads\n", threadsCount);
! if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jvmtiError)),
(unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
*** 93,104 ****
NSK_DISPLAY1("Find threads: %d threads\n", threadsCount);
if (!NSK_VERIFY(fillThreadsByName(jvmti, jni, THREAD_NAME, threadsCount, threads)))
return;
NSK_DISPLAY0("Suspend threads list\n");
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Check threads results:\n");
--- 91,101 ----
NSK_DISPLAY1("Find threads: %d threads\n", threadsCount);
if (!NSK_VERIFY(fillThreadsByName(jvmti, jni, THREAD_NAME, threadsCount, threads)))
return;
NSK_DISPLAY0("Suspend threads list\n");
! if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Check threads results:\n");
*** 136,147 ****
NSK_DISPLAY1("Disable event: %s\n", "THREAD_END");
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL))
return;
NSK_DISPLAY0("Resume threads list\n");
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Wait for thread to finish\n");
--- 133,143 ----
NSK_DISPLAY1("Disable event: %s\n", "THREAD_END");
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL))
return;
NSK_DISPLAY0("Resume threads list\n");
! if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Wait for thread to finish\n");
*** 149,170 ****
return;
NSK_DISPLAY0("Delete threads references\n");
for (i = 0; i < threadsCount; i++) {
if (threads[i] != NULL)
! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threads[i]));
}
NSK_DISPLAY1("Deallocate threads array: %p\n", (void*)threads);
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY1("Deallocate results array: %p\n", (void*)results);
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
}
NSK_DISPLAY0("Let debugee to finish\n");
--- 145,164 ----
return;
NSK_DISPLAY0("Delete threads references\n");
for (i = 0; i < threadsCount; i++) {
if (threads[i] != NULL)
! NSK_TRACE(jni->DeleteGlobalRef(threads[i]));
}
NSK_DISPLAY1("Deallocate threads array: %p\n", (void*)threads);
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY1("Deallocate results array: %p\n", (void*)results);
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
}
NSK_DISPLAY0("Let debugee to finish\n");
*** 186,207 ****
for (i = 0; i < foundCount; i++) {
foundThreads[i] = NULL;
}
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(GetAllThreads, jvmti, &count, &threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
found = 0;
for (i = 0; i < count; i++) {
jvmtiThreadInfo info;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info))) {
nsk_jvmti_setFailStatus();
break;
}
if (info.name != NULL && strncmp(name, info.name, len) == 0) {
--- 180,199 ----
for (i = 0; i < foundCount; i++) {
foundThreads[i] = NULL;
}
! if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&count, &threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
found = 0;
for (i = 0; i < count; i++) {
jvmtiThreadInfo info;
! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info))) {
nsk_jvmti_setFailStatus();
break;
}
if (info.name != NULL && strncmp(name, info.name, len) == 0) {
*** 212,223 ****
found++;
}
}
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
if (found != foundCount) {
--- 204,214 ----
found++;
}
}
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
if (found != foundCount) {
*** 231,241 ****
}
NSK_DISPLAY1("Make global references for threads: %d threads\n", foundCount);
for (i = 0; i < foundCount; i++) {
if (!NSK_JNI_VERIFY(jni, (foundThreads[i] = (jthread)
! NSK_CPP_STUB2(NewGlobalRef, jni, foundThreads[i])) != NULL)) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
NSK_DISPLAY2(" ... thread #%d: %p\n", i, foundThreads[i]);
}
--- 222,232 ----
}
NSK_DISPLAY1("Make global references for threads: %d threads\n", foundCount);
for (i = 0; i < foundCount; i++) {
if (!NSK_JNI_VERIFY(jni, (foundThreads[i] = (jthread)
! jni->NewGlobalRef(foundThreads[i])) != NULL)) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
NSK_DISPLAY2(" ... thread #%d: %p\n", i, foundThreads[i]);
}
*** 251,261 ****
int i;
/* check if event is for tested thread */
for (i = 0; i < threadsCount; i++) {
if (thread != NULL &&
! NSK_CPP_STUB3(IsSameObject, jni, threads[i], thread)) {
NSK_DISPLAY2(" ... received THREAD_END event for thread #%d: %p\n",
i, (void*)thread);
eventsReceived++;
return;
}
--- 242,252 ----
int i;
/* check if event is for tested thread */
for (i = 0; i < threadsCount; i++) {
if (thread != NULL &&
! jni->IsSameObject(threads[i], thread)) {
NSK_DISPLAY2(" ... received THREAD_END event for thread #%d: %p\n",
i, (void*)thread);
eventsReceived++;
return;
}
*** 299,320 ****
/* 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)))
--- 290,309 ----
/* 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 >