git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@652300 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-04-30 06:36:53 +00:00
parent c4aae53139
commit 9341f16442
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class DataFile extends LinkedNode implements Comparable<DataFile> {
return result; return result;
} }
public RandomAccessFile openRandomAccessFile(boolean appender) throws IOException { public synchronized RandomAccessFile openRandomAccessFile(boolean appender) throws IOException {
RandomAccessFile rc = new RandomAccessFile(file, "rw"); RandomAccessFile rc = new RandomAccessFile(file, "rw");
// When we start to write files size them up so that the OS has a chance // When we start to write files size them up so that the OS has a chance
// to allocate the file contigously. // to allocate the file contigously.
@ -97,7 +97,7 @@ public class DataFile extends LinkedNode implements Comparable<DataFile> {
return rc; 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. // On close set the file size to the real size.
if (length != file.length()) { if (length != file.length()) {
file.setLength(getLength()); file.setLength(getLength());