Skip to content

Commit 25e8714

Browse files
David Holmesreinrich
andcommitted
8369515: Deadlock between JVMTI and JNI ReleasePrimitiveArrayCritical
Co-authored-by: Richard Reingruber <rrich@openjdk.org> Reviewed-by: rrich, fbredberg, pchilanomate
1 parent 8ab7d3b commit 25e8714

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hotspot/share/runtime/javaThread.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,11 @@ void JavaThread::set_exception_oop(oop o) {
10521052
}
10531053

10541054
void JavaThread::handle_special_runtime_exit_condition() {
1055-
if (is_obj_deopt_suspend()) {
1055+
// We mustn't block for object deopt if the thread is
1056+
// currently executing in a JNI critical region, as that
1057+
// can cause deadlock because allocation may be locked out
1058+
// and the object deopt suspender may try to allocate.
1059+
if (is_obj_deopt_suspend() && !in_critical()) {
10561060
frame_anchor()->make_walkable();
10571061
wait_for_object_deoptimization();
10581062
}

0 commit comments

Comments
 (0)