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 Apr 5, 2024
1 parent 66fa62a commit af033c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hotspot/src/share/vm/runtime/mutexLocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ void mutex_init() {

def(StringDedupQueue_lock , Monitor, leaf, true );
def(StringDedupTable_lock , Mutex , leaf, true );

def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support
}
def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support

def(ParGCRareEvent_lock , Mutex , leaf , true );
def(DerivedPointerTableGC_lock , Mutex, leaf, true );
def(CodeCache_lock , Mutex , special, true );
Expand Down
1 change: 1 addition & 0 deletions hotspot/src/share/vm/services/management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env))
}

{
assert(MonitoringSupport_lock != NULL, "Must be");
MutexLockerEx ml(MonitoringSupport_lock, Mutex::_no_safepoint_check_flag);
if (result < high_water_result) {
// Result wrapped to a negative value, in which case it's
Expand Down
Original file line number Diff line number Diff line change
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 af033c6

@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.