RFR(XXS): 8234433: TestUnloadEventClassCount fails with "assert(SafepointSynchronize::is_at_safepoint()) failed: invariant"
Markus Gronlund
markus.gronlund at oracle.com
Thu Nov 21 10:26:49 UTC 2019
Hi,
Please help review this small change:
Bug: https://bugs.openjdk.java.net/browse/JDK-8234433
Webrev: http://cr.openjdk.java.net/~mgronlun/8234433/webrev/
Diff:
diff -r 7567ce83f3b5 -r f48ca1c7feda src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp
--- a/src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp Thu Nov 21 13:50:11 2019 +0530
+++ b/src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp Thu Nov 21 11:13:34 2019 +0100
@@ -33,12 +33,11 @@
#include "memory/resourceArea.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/mutexLocker.hpp"
-#include "runtime/safepoint.hpp"
#include "runtime/thread.inline.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/stack.inline.hpp"
- // incremented during class unloading (safepoint) for each unloaded event class
+ // incremented during class unloading for each unloaded event class
static jlong unloaded_event_classes = 0;
jlong JfrEventClasses::unloaded_event_classes_count() {
@@ -46,8 +45,7 @@
}
void JfrEventClasses::increment_unloaded_event_class() {
- // incremented during class unloading (safepoint) for each unloaded event class
- assert(SafepointSynchronize::is_at_safepoint(), "invariant");
+ assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
++unloaded_event_classes;
}
Thanks
Markus
More information about the hotspot-jfr-dev
mailing list