Skip to content

Commit

Permalink
8313081: MonitoringSupport_lock should be unconditionally initialized…
Browse files Browse the repository at this point in the history
… after 8304074

Reviewed-by: simonis
Backport-of: a9d21c61fb12a11e18c6bb8aa903e5a8e42473f1
  • Loading branch information
Paul Hohensee committed Dec 7, 2023
1 parent 0bbbd14 commit bf7c221
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/mutexLocker.cpp
Expand Up @@ -227,9 +227,9 @@ void mutex_init() {

def(MarkStackFreeList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
def(MarkStackChunkList_lock , PaddedMutex , leaf , true, _safepoint_check_never);

def(MonitoringSupport_lock , PaddedMutex , native , true, _safepoint_check_never); // used for serviceability monitoring support
}
def(MonitoringSupport_lock , PaddedMutex , native , true, _safepoint_check_never); // used for serviceability monitoring support

def(StringDedup_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
def(StringDedupIntern_lock , PaddedMutex , leaf, true, _safepoint_check_never);
def(ParGCRareEvent_lock , PaddedMutex , leaf, true, _safepoint_check_always);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/services/management.cpp
Expand Up @@ -2086,6 +2086,7 @@ JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env))
}

{
assert(MonitoringSupport_lock != nullptr, "Must be");
MutexLocker ml(MonitoringSupport_lock, Mutex::_no_safepoint_check_flag);
if (result < high_water_result) {
// Encountered (2) above, or result wrapped to a negative value. In
Expand Down
Expand Up @@ -22,10 +22,19 @@
*/

/*
* @test
* @bug 6173675 8231209 8304074
* @test id=G1
* @bug 6173675 8231209 8304074 8313081
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
* @author Paul Hohensee
* @requires vm.gc.G1
* @run main/othervm -XX:+UseG1GC ThreadAllocatedMemory
*/

/*
* @test id=Serial
* @bug 6173675 8231209 8304074 8313081
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
* @requires vm.gc.Serial
* @run main/othervm -XX:+UseSerialGC ThreadAllocatedMemory
*/

import java.lang.management.*;
Expand Down

1 comment on commit bf7c221

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.