summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-10-27 17:22:26 -0700
committerRichard Linden <none@none>2011-10-27 17:22:26 -0700
commit6e8ffc247fe52668446b8fa1ed7f1547a755076f (patch)
tree23b6fa5ce6bf6a32944faca54f9a18aca255fd75 /indra/llvfs
parent0ecc5c0878adf93e96b99e3db4c65cdb757b99fb (diff)
parentfcd1ccd21e3ea8f0944537347dd6c9d7972d50ce (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
Diffstat (limited to 'indra/llvfs')
-rw-r--r--indra/llvfs/lllfsthread.cpp10
-rw-r--r--indra/llvfs/llvfs.cpp5
2 files changed, 11 insertions, 4 deletions
diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp
index bf49b9668e..3d3ed9f6d4 100644
--- a/indra/llvfs/lllfsthread.cpp
+++ b/indra/llvfs/lllfsthread.cpp
@@ -67,6 +67,10 @@ LLLFSThread::LLLFSThread(bool threaded) :
LLQueuedThread("LFS", threaded),
mPriorityCounter(PRIORITY_LOWBITS)
{
+ if(!mLocalAPRFilePoolp)
+ {
+ mLocalAPRFilePoolp = new LLVolatileAPRPool() ;
+ }
}
LLLFSThread::~LLLFSThread()
@@ -178,7 +182,8 @@ bool LLLFSThread::Request::processRequest()
if (mOperation == FILE_READ)
{
llassert(mOffset >= 0);
- LLAPRFile infile(mFileName, LL_APR_RB);
+ LLAPRFile infile ; // auto-closes
+ infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool());
if (!infile.getFileHandle())
{
llwarns << "LLLFS: Unable to read file: " << mFileName << llendl;
@@ -200,7 +205,8 @@ bool LLLFSThread::Request::processRequest()
apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY;
if (mOffset < 0)
flags |= APR_APPEND;
- LLAPRFile outfile(mFileName, flags);
+ LLAPRFile outfile ; // auto-closes
+ outfile.open(mFileName, flags, mThread->getLocalAPRFilePool());
if (!outfile.getFileHandle())
{
llwarns << "LLLFS: Unable to write file: " << mFileName << llendl;
diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp
index ade19f8103..82c926620a 100644
--- a/indra/llvfs/llvfs.cpp
+++ b/indra/llvfs/llvfs.cpp
@@ -234,7 +234,7 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename
mDataFP(NULL),
mIndexFP(NULL)
{
- mDataMutex = new LLMutex;
+ mDataMutex = new LLMutex(0);
S32 i;
for (i = 0; i < VFSLOCK_COUNT; i++)
@@ -2098,7 +2098,8 @@ void LLVFS::dumpFiles()
std::string filename = id.asString() + extension;
llinfos << " Writing " << filename << llendl;
- LLAPRFile outfile(filename, LL_APR_WB);
+ LLAPRFile outfile;
+ outfile.open(filename, LL_APR_WB);
outfile.write(&buffer[0], size);
outfile.close();