Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv30087
Modified Files:
imp.java
Log Message:
getSyspathJavaLoader(): Added separate locking object to avoid
synchronizing on the class. While the import mechanism was running,
another thread was not able to load java code.
The problem was exposed by test266.
Index: imp.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v
retrieving revision 2.46
retrieving revision 2.47
diff -C2 -r2.46 -r2.47
*** imp.java 2001/06/14 19:40:01 2.46
--- imp.java 2001/07/14 22:25:35 2.47
***************
*** 168,176 ****
}
private static ClassLoader syspathJavaLoader = null;
! public static synchronized ClassLoader getSyspathJavaLoader() {
! if (syspathJavaLoader == null)
! syspathJavaLoader = new SyspathJavaLoader();
return syspathJavaLoader;
}
--- 168,180 ----
}
+ private static Object syspathJavaLoaderLock = new Object();
private static ClassLoader syspathJavaLoader = null;
! public static ClassLoader getSyspathJavaLoader() {
! synchronized (syspathJavaLoaderLock) {
! if (syspathJavaLoader == null) {
! syspathJavaLoader = new SyspathJavaLoader();
! }
! }
return syspathJavaLoader;
}
|