xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r697270 - /xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
Date Fri, 19 Sep 2008 22:31:54 GMT
Author: cezar
Date: Fri Sep 19 15:31:54 2008
New Revision: 697270

URL: http://svn.apache.org/viewvc?rev=697270&view=rev
Log:
Adding enter/exit locale and synch for available method.



Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=697270&r1=697269&r2=697270&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Fri Sep 19 15:31:54
2008
@@ -2502,7 +2502,13 @@
         public int available()
             throws IOException
         {
-	        return ensure(1024);
+            if (_locale.noSync())
+                { _locale.enter(); try {
+                    return ensure(1024);
+                } finally { _locale.exit(); } }
+            else
+                synchronized ( _locale )
+                { _locale.enter(); try { return ensure(1024); } finally { _locale.exit();
} }
         }
 
         private final class OutputStreamImpl extends OutputStream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message