mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@652300 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c4aae53139
commit
9341f16442
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue