--- old/test/hotspot/jtreg/gc/g1/libTestPeriodicCollectionJNI.c 2019-02-27 13:35:24.891484489 +0100 +++ new/test/hotspot/jtreg/gc/g1/libTestPeriodicCollectionJNI.c 2019-02-27 13:35:24.600475641 +0100 @@ -27,6 +27,16 @@ #include "jni.h" +#ifdef WINDOWS +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + static volatile int release_critical = 0; JNIEXPORT jboolean JNICALL @@ -37,7 +47,13 @@ return JNI_FALSE; } - while (!release_critical) /* empty */; + while (!release_critical) { +#ifdef WINDOWS + Sleep(1); +#else + usleep(1000); +#endif + } (*env)->ReleasePrimitiveArrayCritical(env, dummy, native_array, 0); @@ -49,3 +65,7 @@ release_critical = 1; } +#ifdef __cplusplus +} +#endif +