JNI ReleasePrimitiveArrayCritical with mode JNI_COMMIT shouldn't end critical region
irogers at google.com
Tue Dec 5 23:15:29 UTC 2017
"The semantics of these two functions are very similar to the existing
Get/Release<primitivetype>ArrayElements functions. "
"JNI_COMMIT copy back the content but do not free the elems buffer"
Consider the pattern of:
where the first release is to just achieve a copy back. For example,
jniCheck.cpp will copy back but not free a copy in the case of JNI_COMMIT
for a critical. The implementation of ReleasePrimitiveArrayCritical ignores
all arguments and so it ends the critical region even in the event of a
The attached patch makes ReleasePrimitiveArrayCritical consider the mode
argument when releasing the GCLocker.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 759 bytes
Desc: not available
More information about the hotspot-dev