Author: imario
Date: Tue Nov  7 13:59:30 2006
New Revision: 472294

URL: http://svn.apache.org/viewvc?view=rev&rev=472294
Log:
VFS-98: try to avoid deadlock

Modified:
    
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileProvider.java
    
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java

Modified: 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileProvider.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileProvider.java?view=diff&rev=472294&r1=472293&r2=472294
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileProvider.java
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileProvider.java
 Tue Nov  7 13:59:30 2006
@@ -66,7 +66,7 @@
      */
     public void close()
     {
-        synchronized (fileSystems)
+        synchronized (this)
         {
             fileSystems.clear();
         }
@@ -97,7 +97,7 @@
         FileSystemKey treeKey = new FileSystemKey(key, 
fs.getFileSystemOptions());
         ((AbstractFileSystem) fs).setCacheKey(treeKey);
 
-        synchronized (fileSystems)
+        synchronized (this)
         {
             fileSystems.put(treeKey, fs);
         }
@@ -112,7 +112,7 @@
     {
         FileSystemKey treeKey = new FileSystemKey(key, fileSystemProps);
 
-        synchronized (fileSystems)
+        synchronized (this)
         {
             return (FileSystem) fileSystems.get(treeKey);
         }
@@ -126,7 +126,7 @@
     public void freeUnusedResources()
     {
         Object[] item;
-        synchronized (fileSystems)
+        synchronized (this)
         {
             item = fileSystems.values().toArray();
         }
@@ -144,7 +144,7 @@
     {
         AbstractFileSystem fs = (AbstractFileSystem) filesystem;
 
-        synchronized (fileSystems)
+        synchronized (this)
         {
             if (fs.getCacheKey() != null)
             {

Modified: 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java?view=diff&rev=472294&r1=472293&r2=472294
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java
 Tue Nov  7 13:59:30 2006
@@ -67,11 +67,12 @@
     protected FileObject findFile(final FileName name, final FileSystemOptions 
fileSystemOptions)
         throws FileSystemException
     {
+               // Check in the cache for the file system
+               final FileName rootName = 
getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);
+               
                FileSystem fs;
                synchronized (this)
                {
-                       // Check in the cache for the file system
-                       final FileName rootName = 
getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);
                        fs = findFileSystem(rootName, fileSystemOptions);
                        if (fs == null)
                        {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to