commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r411073 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Date Fri, 02 Jun 2006 07:15:44 GMT
Author: imario
Date: Fri Jun  2 00:15:44 2006
New Revision: 411073

URL: http://svn.apache.org/viewvc?rev=411073&view=rev
Log:
fixed deadlock situation
I had to fix it by synchronizing against the filesystem instead of the file only.
This doesnt make me fully happy, but on the other hand this makes somehow sense.
Many file operations change the filesystem and thus require this lock anyway.

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java?rev=411073&r1=411072&r2=411073&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Fri Jun  2 00:15:44 2006
@@ -503,7 +503,7 @@
             }
         }
 
-        synchronized (this)
+        synchronized (fs)
         {
             // Locate the parent of this file
             if (parent == null)
@@ -519,7 +519,7 @@
      */
     public FileObject[] getChildren() throws FileSystemException
     {
-        synchronized (this)
+        synchronized (fs)
         {
             attach();
             if (!type.hasChildren())
@@ -677,7 +677,7 @@
      */
     private boolean deleteSelf() throws FileSystemException
     {
-        synchronized (this)
+        synchronized (fs)
         {
             /* Its possible to delete a read-only file if you have write-execute access to
the directory
             if (!isWriteable())
@@ -773,7 +773,7 @@
      */
     public void createFile() throws FileSystemException
     {
-        synchronized (this)
+        synchronized (fs)
         {
             try
             {
@@ -797,7 +797,7 @@
      */
     public void createFolder() throws FileSystemException
     {
-        synchronized (this)
+        synchronized (fs)
         {
             if (getType() == FileType.FOLDER)
             {
@@ -1206,7 +1206,7 @@
      */
     private void detach() throws Exception
     {
-        synchronized (this)
+        synchronized (fs)
         {
             if (attached)
             {
@@ -1250,7 +1250,7 @@
      */
     private void attach() throws FileSystemException
     {
-        synchronized (this)
+        synchronized (fs)
         {
             if (attached)
             {
@@ -1304,7 +1304,7 @@
      */
     protected void handleCreate(final FileType newType) throws Exception
     {
-        synchronized (this)
+        synchronized (fs)
         {
             if (attached)
             {
@@ -1332,7 +1332,7 @@
      */
     protected void handleDelete() throws Exception
     {
-        synchronized (this)
+        synchronized (fs)
         {
             if (attached)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message