8309462: [AIX] vmTestbase/nsk/jvmti/RunAgentThread/agentthr001/TestDescription.java crashing due to empty while loop

Reviewed-by: mbaesken, mdoerr, clanger
This commit is contained in:
JoKern65 2023-06-12 10:01:13 +00:00 committed by Martin Doerr
parent 268ec61d4f
commit cf9e6353cc

View File

@ -136,7 +136,11 @@ sys_thread_2(jvmtiEnv* jvmti, JNIEnv* jni, void *p) {
static void JNICALL
sys_thread_3(jvmtiEnv* jvmti, JNIEnv* jni, void *p) {
while (1) {
/* The volatile variable in the loop body is necessary
* to avoid the compiler optimization to elide the loop. */
volatile int i = 1;
while (i) {
i += 2;
}
}