hotspot/src/share/vm/classfile/classLoaderData.cpp
changeset 24658 e41df2fc6e87
parent 24457 0e20b36df5c4
child 25051 8110ec6e7340
equal deleted inserted replaced
24462:0676642e6560 24658:e41df2fc6e87
   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;