You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2008/04/30 08:36:53 UTC

svn commit: r652300 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java

Author: rajdavies
Date: Tue Apr 29 23:36:53 2008
New Revision: 652300

URL: http://svn.apache.org/viewvc?rev=652300&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1701

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java?rev=652300&r1=652299&r2=652300&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java Tue Apr 29 23:36:53 2008
@@ -85,7 +85,7 @@
         return result;
     }
 
-    public RandomAccessFile openRandomAccessFile(boolean appender) throws IOException {
+    public synchronized RandomAccessFile openRandomAccessFile(boolean appender) throws IOException {
         RandomAccessFile rc = new RandomAccessFile(file, "rw");
         // When we start to write files size them up so that the OS has a chance
         // to allocate the file contigously.
@@ -97,7 +97,7 @@
         return rc;
     }
 
-    public void closeRandomAccessFile(RandomAccessFile file) throws IOException {
+    public synchronized void closeRandomAccessFile(RandomAccessFile file) throws IOException {
         // On close set the file size to the real size.
         if (length != file.length()) {
             file.setLength(getLength());