8223391: Unsynchronized iteration of ClassLoaderDataGraph
Lock in G1 before clear_claimed_marks Reviewed-by: hseigel, lfoltan, tschatzl
This commit is contained in:
parent
40fddae1dc
commit
dc2c1d3ba8
@ -48,6 +48,7 @@ volatile size_t ClassLoaderDataGraph::_num_array_classes = 0;
|
||||
volatile size_t ClassLoaderDataGraph::_num_instance_classes = 0;
|
||||
|
||||
void ClassLoaderDataGraph::clear_claimed_marks() {
|
||||
assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
|
||||
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
|
||||
cld->clear_claim();
|
||||
}
|
||||
|
@ -268,6 +268,7 @@ void G1ConcurrentMarkThread::run_service() {
|
||||
|
||||
{
|
||||
G1ConcPhase p(G1ConcurrentPhase::CLEAR_CLAIMED_MARKS, this);
|
||||
MutexLocker ml(ClassLoaderDataGraph_lock);
|
||||
ClassLoaderDataGraph::clear_claimed_marks();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user