Skip to content

Commit 0146077

Browse files
committed
8373723: Deadlock with JvmtiTagMap::flush_object_free_events()
Reviewed-by: dholmes, coleenp
1 parent ea58344 commit 0146077

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/prims/jvmtiTagMap.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,10 @@ void JvmtiTagMap::flush_object_free_events() {
12041204
assert_not_at_safepoint();
12051205
if (env()->is_enabled(JVMTI_EVENT_OBJECT_FREE)) {
12061206
{
1207+
// The other thread can block for safepoints during event callbacks, so ensure we
1208+
// are safepoint-safe while waiting.
1209+
ThreadBlockInVM tbivm(JavaThread::current());
12071210
MonitorLocker ml(lock(), Mutex::_no_safepoint_check_flag);
1208-
// If another thread is posting events, let it finish
12091211
while (_posting_events) {
12101212
ml.wait();
12111213
}

0 commit comments

Comments
 (0)