8336846: assert(state->get_thread() == jt) failed: handshake unsafe conditions

Reviewed-by: amenkov, dholmes, cjplummer, pchilanomate, lmesnik
This commit is contained in:
Serguei Spitsyn 2024-08-07 17:41:23 +00:00
parent d19ba81ce1
commit 36d08c213d
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -982,6 +982,8 @@ JvmtiEventControllerPrivate::change_field_watch(jvmtiEvent event_type, bool adde
added? "add" : "remove",
*count_addr));
JvmtiVTMSTransitionDisabler disabler;
if (added) {
(*count_addr)++;
if (*count_addr == 1) {

View File

@ -269,7 +269,6 @@ void mutex_init() {
MUTEX_DEFN(JvmtiThreadState_lock , PaddedMutex , safepoint); // Used by JvmtiThreadState/JvmtiEventController
MUTEX_DEFN(EscapeBarrier_lock , PaddedMonitor, nosafepoint); // Used to synchronize object reallocation/relocking triggered by JVMTI
MUTEX_DEFN(JvmtiVTMSTransition_lock , PaddedMonitor, safepoint); // used for Virtual Thread Mount State transition management
MUTEX_DEFN(Management_lock , PaddedMutex , safepoint); // used for JVM management
MUTEX_DEFN(ConcurrentGCBreakpoints_lock , PaddedMonitor, safepoint, true);
@ -355,6 +354,7 @@ void mutex_init() {
// JVMCIRuntime_lock must be acquired before JVMCI_lock to avoid deadlock
MUTEX_DEFL(JVMCI_lock , PaddedMonitor, JVMCIRuntime_lock);
#endif
MUTEX_DEFL(JvmtiVTMSTransition_lock , PaddedMonitor, JvmtiThreadState_lock); // used for Virtual Thread Mount State transition management
// Allocate RecursiveMutex
MultiArray_lock = new RecursiveMutex();