test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach020/attach020Agent00.cpp
changeset 52221 27ba7cc31f9f
parent 52044 054a24c46812
child 52293 d01d4bd7c5b3
equal deleted inserted replaced
52220:9c260a6b6471 52221:27ba7cc31f9f
   116     jthread thread;
   116     jthread thread;
   117 
   117 
   118     if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThread(jni)) != NULL))
   118     if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThread(jni)) != NULL))
   119         return NSK_FALSE;
   119         return NSK_FALSE;
   120 
   120 
   121     if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, auxiliaryThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY ))) {
   121     if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, auxiliaryThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
   122         return NSK_FALSE;
   122         return NSK_FALSE;
   123     }
   123     }
   124 
   124 
   125     NSK_DISPLAY1("%s: auxiliary thread was started\n", agentName);
   125     NSK_DISPLAY1("%s: auxiliary thread was started\n", agentName);
   126 
   126 
   163     if (!NSK_VERIFY(startAuxiliaryThread(jvmti, jni)))
   163     if (!NSK_VERIFY(startAuxiliaryThread(jvmti, jni)))
   164         return JNI_ERR;
   164         return JNI_ERR;
   165 
   165 
   166     memset(&caps, 0, sizeof(caps));
   166     memset(&caps, 0, sizeof(caps));
   167     caps.can_generate_garbage_collection_events = 1;
   167     caps.can_generate_garbage_collection_events = 1;
   168     if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
   168     if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
   169         return JNI_ERR;
   169         return JNI_ERR;
   170     }
   170     }
   171 
   171 
   172     memset(&eventCallbacks,0, sizeof(eventCallbacks));
   172     memset(&eventCallbacks,0, sizeof(eventCallbacks));
   173     eventCallbacks.GarbageCollectionStart  = garbageCollectionStartHandler;
   173     eventCallbacks.GarbageCollectionStart  = garbageCollectionStartHandler;
   174     eventCallbacks.GarbageCollectionFinish = garbageCollectionFinishHandler;
   174     eventCallbacks.GarbageCollectionFinish = garbageCollectionFinishHandler;
   175     if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
   175     if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
   176         return JNI_ERR;
   176         return JNI_ERR;
   177     }
   177     }
   178 
   178 
   179     if (!(nsk_jvmti_aod_enableEvents(jvmti, testEvents, testEventsNumber))) {
   179     if (!(nsk_jvmti_aod_enableEvents(jvmti, testEvents, testEventsNumber))) {
   180         return JNI_ERR;
   180         return JNI_ERR;