Fixes concurrency issue where a classload in a concurrent environment with a large number of classes can cause a loss of a TypeRegistry entry
This commit is contained in:
@@ -1125,10 +1125,13 @@ public class TypeRegistry {
|
||||
if (typeId >= reloadableTypes.length) {
|
||||
resizeReloadableTypeArray(typeId);
|
||||
}
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
synchronized(this) {
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// allocatedIds.put(slashname, rtype);
|
||||
// allocatedButNotYetRegisteredItds.remove(slashname);
|
||||
int cglibIndex = slashname.indexOf("$$EnhancerBy");
|
||||
@@ -1196,10 +1199,13 @@ public class TypeRegistry {
|
||||
if (typeId >= reloadableTypes.length) {
|
||||
resizeReloadableTypeArray(typeId);
|
||||
}
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
synchronized(this) {
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface AbstractFileSystemWatcher {
|
||||
/**
|
||||
* Shutdown the thread.
|
||||
*/
|
||||
public void shutdown();
|
||||
|
||||
/**
|
||||
* Add a new file to the list of those being monitored. If the file is something that can be watched, then this
|
||||
* method will cause the thread to start (if it hasn't already been started).
|
||||
*
|
||||
* @param fileToMonitor the file to start monitor
|
||||
*/
|
||||
public void register(File fileToMonitor);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
public class MacOsFileSystemWatcher {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
public class PollingFileSystemWatcher {
|
||||
}
|
||||
Reference in New Issue
Block a user