test/hotspot/jtreg/vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit001/rawmonexit001.cpp
equal
deleted
inserted
replaced
25 #include <string.h> |
25 #include <string.h> |
26 #include "jvmti.h" |
26 #include "jvmti.h" |
27 #include "agent_common.h" |
27 #include "agent_common.h" |
28 #include "JVMTITools.h" |
28 #include "JVMTITools.h" |
29 |
29 |
30 #ifdef __cplusplus |
|
31 extern "C" { |
30 extern "C" { |
32 #endif |
31 |
33 |
|
34 #ifndef JNI_ENV_ARG |
|
35 |
|
36 #ifdef __cplusplus |
|
37 #define JNI_ENV_ARG(x, y) y |
|
38 #define JNI_ENV_PTR(x) x |
|
39 #else |
|
40 #define JNI_ENV_ARG(x,y) x, y |
|
41 #define JNI_ENV_PTR(x) (*x) |
|
42 #endif |
|
43 |
|
44 #endif |
|
45 |
32 |
46 #define PASSED 0 |
33 #define PASSED 0 |
47 #define STATUS_FAILED 2 |
34 #define STATUS_FAILED 2 |
48 #define RAW_MONITORS_NUMBER 1024 |
35 #define RAW_MONITORS_NUMBER 1024 |
49 |
36 |
130 |
117 |
131 if (options != NULL && strcmp(options, "printdump") == 0) { |
118 if (options != NULL && strcmp(options, "printdump") == 0) { |
132 printdump = JNI_TRUE; |
119 printdump = JNI_TRUE; |
133 } |
120 } |
134 |
121 |
135 res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), |
122 res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1); |
136 JVMTI_VERSION_1_1); |
|
137 if (res != JNI_OK || jvmti == NULL) { |
123 if (res != JNI_OK || jvmti == NULL) { |
138 printf("Wrong result of a valid call to GetEnv!\n"); |
124 printf("Wrong result of a valid call to GetEnv!\n"); |
139 return JNI_ERR; |
125 return JNI_ERR; |
140 } |
126 } |
141 |
127 |
218 } |
204 } |
219 |
205 |
220 return result; |
206 return result; |
221 } |
207 } |
222 |
208 |
223 #ifdef __cplusplus |
209 } |
224 } |
|
225 #endif |
|