equal
deleted
inserted
replaced
272 |
272 |
273 void ClassLoaderData::add_class(Klass* k) { |
273 void ClassLoaderData::add_class(Klass* k) { |
274 MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); |
274 MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); |
275 Klass* old_value = _klasses; |
275 Klass* old_value = _klasses; |
276 k->set_next_link(old_value); |
276 k->set_next_link(old_value); |
|
277 // Make sure linked class is stable, since the class list is walked without a lock |
|
278 OrderAccess::storestore(); |
277 // link the new item into the list |
279 // link the new item into the list |
278 _klasses = k; |
280 _klasses = k; |
279 |
281 |
280 if (TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) { |
282 if (TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) { |
281 ResourceMark rm; |
283 ResourceMark rm; |