# HG changeset patch # User eosterlund # Date 1540203209 -7200 # Node ID e6973df151528100f8bceb2bddd198ecd05f1efa # Parent f298d05357fe50f988cb8e9d1d6bce44bd6f6fd2 8212663: Remove conservative at_safepoint assert when JFR writes type sets during class unloading Reviewed-by: coleenp, dholmes, mgronlun diff -r f298d05357fe -r e6973df15152 src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp --- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp Mon Oct 22 12:25:31 2018 +0100 +++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp Mon Oct 22 12:13:29 2018 +0200 @@ -367,7 +367,7 @@ } void JfrCheckpointManager::write_type_set_for_unloaded_classes() { - assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); + assert_locked_or_safepoint(ClassLoaderDataGraph_lock); JfrTypeManager::write_type_set_for_unloaded_classes(); } diff -r f298d05357fe -r e6973df15152 src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp Mon Oct 22 12:25:31 2018 +0100 +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp Mon Oct 22 12:13:29 2018 +0200 @@ -158,7 +158,7 @@ } void JfrTypeManager::write_type_set_for_unloaded_classes() { - assert(SafepointSynchronize::is_at_safepoint(), "invariant"); + assert_locked_or_safepoint(ClassLoaderDataGraph_lock); JfrCheckpointWriter writer(false, true, Thread::current()); ClassUnloadTypeSet class_unload_set; class_unload_set.serialize(writer);