diff -r b756e7a2ec33 src/share/vm/prims/jni.cpp --- a/src/share/vm/prims/jni.cpp Thu Aug 03 18:56:57 2017 +0000 +++ b/src/share/vm/prims/jni.cpp Tue Dec 05 15:05:38 2017 -0800 @@ -3194,8 +3194,10 @@ JNI_ENTRY(void, jni_ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void *carray, jint mode)) JNIWrapper("ReleasePrimitiveArrayCritical"); HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_ENTRY(env, array, carray, mode); - // The array, carray and mode arguments are ignored - GCLocker::unlock_critical(thread); + // The array and carray arguments are ignored. End the critical region unless this is a commit. + if (mode != JNI_COMMIT) { + GCLocker::unlock_critical(thread); + } HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN(); JNI_END